/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * articulos_sie_editar.java
 *
 * Created on 15/03/2012, 04:30:24 PM
 */

package sie_invdis;

import java.sql.*;
import javax.swing.*;

import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.JTable.*;
import java.awt.*;
import java.text.*;
import java.util.Date;
import java.util.Calendar;
import java.text.SimpleDateFormat;
import java.text.ParseException;


import org.jfree.data.category.DefaultCategoryDataset;
import org.jfree.ui.RefineryUtilities;

/**
 *
 * @author Administrador
 */
public class articulos_sie_editar extends javax.swing.JFrame {
 private int tiendasel=0,indexactual=0,yacargueestadistica=0,yacargueventaxmes=0,yacarguedistrialma=0,controlcombotv=0,controlcombola=0,controlcombote=0,yacarguederibadas=0,yacarguearticulostienda=0,indexjtapestana=0;
    bd_conexion x = new bd_conexion() ;
    ResultSet rs = null;
    private javax.swing.table.DefaultTableModel jtable_modelo;
    private javax.swing.table.DefaultTableModel jtable_modelo_kardex;
    private javax.swing.table.DefaultTableModel jtable_modelo_estadisticas;
    private javax.swing.table.DefaultTableModel jtable_modelo_ventamensual;

    private javax.swing.table.DefaultTableModel jtable_modelo_distribucionalma;
    private javax.swing.table.DefaultTableModel jtable_modelo_clavesderivadas;
    private javax.swing.table.DefaultTableModel jtable_modelo_kardex_deridestribucion;
    private javax.swing.table.DefaultTableModel jtable_modelo_Artihistorifisico;
    private javax.swing.table.DefaultTableModel jtable_modelo_ifh;

    private javax.swing.table.DefaultTableModel jtable_modelo_kardexb;

    private SimpleDateFormat formateador = new SimpleDateFormat("dd-MM-yyyy");
    private SimpleDateFormat formateadoresta = new SimpleDateFormat("yyyy-MM-dd");
    DecimalFormat miformat = new DecimalFormat("############.#####");
    DecimalFormat miformatd = new DecimalFormat("############.####");
    /** Creates new form articulos_sie_editar */
    public articulos_sie_editar() {
        initComponents();
    }
     public articulos_sie_editar(String idarticulo) {

     this.iniciar_modelo_de_tabla();
     this.iniciar_modelo_kardex();
     this.iniciar_modelo_kardexb();
     this.iniciar_modelo_articuloestadistica();
     this.iniciar_modelo_articuloventaxmes();
     this.iniciar_modelo_distribucionalma();
     this.iniciar_modelo_submodelos();
     this.iniciar_modelo_kardex_derivadadistribucion();
     this.iniciar_modelo_articulofisicohistorial();
     this.iniciar_modelo_invefisicohistorial();
     System.out.println("antes de iniciarcomponentes");
        initComponents();
this.jbtn_actualizarfamysub.setVisible(false);
 System.out.println("despues de inicomponentes");
     //this.buttonGroup1.setSelected(jrbtn_all.getModel(), true);
     this.jep_articuloimagen.setContentType("text/html");
     this.carga_datos_general(10,idarticulo);
       this.setLocation(5,5);
       
       if(variables_global.getLogin().toString().equals("administrador"))
        {
            this.jbtn_creaentienda.setVisible(true);
        }
       else
        {
            this.jbtn_creaentienda.setVisible(false);
        }
       System.out.println("este esl el usuario"+variables_global.getbdLogin().toString());
        this.jbtn_guardar.setVisible(false);
            if (variables_global.getnivelusu()>2)
                {
                    this.jbtn_guardar.setVisible(false);
                    this.jtf_costo.setVisible(false);
                    this.jtf_ultcosto.setVisible(false);
                }
       this.jtf_idfam.requestFocus();
       jtbl_kardex.getColumnModel().getColumn(0).setPreferredWidth(60);//tienda
       jtbl_kardex.getColumnModel().getColumn(1).setPreferredWidth(15);//clave
       jtbl_kardex.getColumnModel().getColumn(2).setPreferredWidth(40);//codigo
       jtbl_kardex.getColumnModel().getColumn(3).setPreferredWidth(80);//descripcion
       jtbl_kardex.getColumnModel().getColumn(4).setPreferredWidth(15);//p. rebaja
       jtbl_kardex.getColumnModel().getColumn(5).setPreferredWidth(60);//stock min
       jtbl_kardex.getColumnModel().getColumn(6).setPreferredWidth(25);//stock max
       jtbl_kardex.getColumnModel().getColumn(7).setPreferredWidth(45);//Existneca
       jtbl_kardex.getColumnModel().getColumn(8).setPreferredWidth(25);//Existneca
       jtbl_kardex.getColumnModel().getColumn(9).setPreferredWidth(25);//Existneca

       jtbl_kardex.getTableHeader().setBackground(Color.yellow);

       jtbl_estadisticasarticulo.getColumnModel().getColumn(0).setPreferredWidth(20);//tienda
       jtbl_estadisticasarticulo.getColumnModel().getColumn(1).setPreferredWidth(20);//clave
       jtbl_estadisticasarticulo.getColumnModel().getColumn(2).setPreferredWidth(20);//codigo
       jtbl_estadisticasarticulo.getColumnModel().getColumn(3).setPreferredWidth(60);//descripcion
       jtbl_estadisticasarticulo.getColumnModel().getColumn(4).setPreferredWidth(15);//descripcion
       jtbl_estadisticasarticulo.getColumnModel().getColumn(5).setPreferredWidth(50);//precio
       jtbl_estadisticasarticulo.getColumnModel().getColumn(6).setPreferredWidth(50);//p. rebaja
       jtbl_estadisticasarticulo.getColumnModel().getColumn(7).setPreferredWidth(40);//stock min
       jtbl_estadisticasarticulo.getColumnModel().getColumn(8).setPreferredWidth(15);//stock max
       jtbl_estadisticasarticulo.getColumnModel().getColumn(9).setPreferredWidth(15);//stock max
       jtbl_estadisticasarticulo.getColumnModel().getColumn(10).setPreferredWidth(15);//stock max
       jtbl_estadisticasarticulo.getColumnModel().getColumn(11).setPreferredWidth(15);//stock max
       jtbl_estadisticasarticulo.getColumnModel().getColumn(12).setPreferredWidth(15);//stock max
       jtbl_estadisticasarticulo.getColumnModel().getColumn(13).setPreferredWidth(50);//stock max
       jtbl_estadisticasarticulo.getColumnModel().getColumn(14).setPreferredWidth(50);//stock max

       jtb_catalogo_derivadas.getColumnModel().getColumn(0).setPreferredWidth(30);//tienda
       jtb_catalogo_derivadas.getColumnModel().getColumn(1).setPreferredWidth(60);//clave
       jtb_catalogo_derivadas.getColumnModel().getColumn(2).setPreferredWidth(180);//codigo
       jtb_catalogo_derivadas.getColumnModel().getColumn(3).setPreferredWidth(30);//descripcion
       jtb_catalogo_derivadas.getColumnModel().getColumn(4).setPreferredWidth(30);//precio
       jtb_catalogo_derivadas.getColumnModel().getColumn(5).setPreferredWidth(30);//p. rebaja
       jtb_catalogo_derivadas.getColumnModel().getColumn(6).setPreferredWidth(50);//stock min

       jtbl_articulosentiendas.getColumnModel().getColumn(0).setPreferredWidth(40);//tienda
       jtbl_articulosentiendas.getColumnModel().getColumn(1).setPreferredWidth(10);//clave
       jtbl_articulosentiendas.getColumnModel().getColumn(2).setPreferredWidth(65);//codigo
       jtbl_articulosentiendas.getColumnModel().getColumn(3).setPreferredWidth(30);//descripcion
       jtbl_articulosentiendas.getColumnModel().getColumn(4).setPreferredWidth(120);//precio
       jtbl_articulosentiendas.getColumnModel().getColumn(5).setPreferredWidth(60);//p. rebaja
       jtbl_articulosentiendas.getColumnModel().getColumn(6).setPreferredWidth(20);//stock min
       jtbl_articulosentiendas.getColumnModel().getColumn(7).setPreferredWidth(20);//p. rebaja
       jtbl_articulosentiendas.getColumnModel().getColumn(8).setPreferredWidth(20);//stock min
       jtbl_articulosentiendas.getColumnModel().getColumn(9).setPreferredWidth(20);//p. rebaja
       jtbl_articulosentiendas.getColumnModel().getColumn(10).setPreferredWidth(20);//stock min
       jtbl_articulosentiendas.getColumnModel().getColumn(11).setPreferredWidth(20);//stock min
       jtbl_articulosentiendas.getColumnModel().getColumn(12).setPreferredWidth(20);//Ultimo Costo
       jtbl_articulosentiendas.getColumnModel().getColumn(13).setPreferredWidth(20);//Ultimo Costo
       jtbl_articulosentiendas.getColumnModel().getColumn(14).setPreferredWidth(20);//Ultimo Costo

       jtbl_kardex1.getColumnModel().getColumn(0).setPreferredWidth(80);//Tienda
       jtbl_kardex1.getColumnModel().getColumn(1).setPreferredWidth(30);//Id mov
       jtbl_kardex1.getColumnModel().getColumn(2).setPreferredWidth(80);//Fecha
       jtbl_kardex1.getColumnModel().getColumn(3).setPreferredWidth(160);//movimiento
       jtbl_kardex1.getColumnModel().getColumn(4).setPreferredWidth(30);//ref
       jtbl_kardex1.getColumnModel().getColumn(5).setPreferredWidth(80);//articulo
       jtbl_kardex1.getColumnModel().getColumn(6).setPreferredWidth(40);//precio
       jtbl_kardex1.getColumnModel().getColumn(7).setPreferredWidth(40);//cli/mov
       jtbl_kardex1.getColumnModel().getColumn(8).setPreferredWidth(40);//cantidad
       jtbl_kardex1.getColumnModel().getColumn(9).setPreferredWidth(40);//cantidad

       jtbl_kardex2.getColumnModel().getColumn(0).setPreferredWidth(80);//Tienda
       jtbl_kardex2.getColumnModel().getColumn(1).setPreferredWidth(30);//Id mov
       jtbl_kardex2.getColumnModel().getColumn(2).setPreferredWidth(80);//Fecha
       jtbl_kardex2.getColumnModel().getColumn(3).setPreferredWidth(160);//movimiento
       jtbl_kardex2.getColumnModel().getColumn(4).setPreferredWidth(30);//ref
       jtbl_kardex2.getColumnModel().getColumn(5).setPreferredWidth(80);//articulo
       jtbl_kardex2.getColumnModel().getColumn(6).setPreferredWidth(40);//precio
       jtbl_kardex2.getColumnModel().getColumn(7).setPreferredWidth(40);//cli/mov
       jtbl_kardex2.getColumnModel().getColumn(8).setPreferredWidth(40);//cantidad
       jtbl_kardex2.getColumnModel().getColumn(9).setPreferredWidth(40);//cantidad

       jtbl_estadisticasarticulo.getTableHeader().setBackground(Color.yellow);

        //jtb_catalogo_distribucionalma.getTableHeader().setPreferredSize(new Dimension(jtb_catalogo_distribucionalma.getTableHeader().getWidth(),60));
        this.loadcombotempoventas();
        controlcombotv=1;
        this.loadcombolineaarticulo();
        controlcombola=1;
        this.loadcombotementrada();
        controlcombote=1;
        this.setTitle("Modulo Articulos: Consultando y Actualizando Datos.("+this.jtf_clave.getText()+":"+this.jtf_descripcion.getText()+")");
        this.jtf_tiendausuario.setText(String.valueOf(variables_global.getidtiendami()));

    }
 public articulos_sie_editar(int opcion,String idarticulo) {

     this.iniciar_modelo_de_tabla();
     this.iniciar_modelo_kardex();
     this.iniciar_modelo_kardexb();
     this.iniciar_modelo_articuloestadistica();
     this.iniciar_modelo_articuloventaxmes();
     this.iniciar_modelo_distribucionalma();
     this.iniciar_modelo_submodelos();
     this.iniciar_modelo_kardex_derivadadistribucion();
     this.iniciar_modelo_articulofisicohistorial();
     this.iniciar_modelo_invefisicohistorial();
     System.out.println("antes de iniciarcomponentes");
        initComponents();
this.jbtn_actualizarfamysub.setVisible(false);
 System.out.println("despues de inicomponentes");
     //this.buttonGroup1.setSelected(jrbtn_all.getModel(), true);
     this.jep_articuloimagen.setContentType("text/html");
     if(opcion==1)
        {
            this.carga_datos_general(12,idarticulo);
        }
     if(opcion==2)
        {
            this.carga_datos_general(15,idarticulo);
        }
       this.setLocation(5,5);

       if(variables_global.getLogin().toString().equals("administrador"))
        {
            this.jbtn_creaentienda.setVisible(true);
        }
       else
        {
            this.jbtn_creaentienda.setVisible(false);
        }
       System.out.println("este esl el usuario"+variables_global.getbdLogin().toString());
        this.jbtn_guardar.setVisible(false);
            if (variables_global.getnivelusu()>2)
                {
                    this.jbtn_guardar.setVisible(false);
                    this.jtf_costo.setVisible(false);
                    this.jtf_ultcosto.setVisible(false);
                }
       this.jtf_idfam.requestFocus();
       jtbl_kardex.getColumnModel().getColumn(0).setPreferredWidth(60);//tienda
       jtbl_kardex.getColumnModel().getColumn(1).setPreferredWidth(15);//clave
       jtbl_kardex.getColumnModel().getColumn(2).setPreferredWidth(40);//codigo
       jtbl_kardex.getColumnModel().getColumn(3).setPreferredWidth(80);//descripcion
       jtbl_kardex.getColumnModel().getColumn(4).setPreferredWidth(15);//p. rebaja
       jtbl_kardex.getColumnModel().getColumn(5).setPreferredWidth(60);//stock min
       jtbl_kardex.getColumnModel().getColumn(6).setPreferredWidth(25);//stock max
       jtbl_kardex.getColumnModel().getColumn(7).setPreferredWidth(45);//Existneca
       jtbl_kardex.getColumnModel().getColumn(8).setPreferredWidth(25);//Existneca
       jtbl_kardex.getColumnModel().getColumn(9).setPreferredWidth(25);//Existneca

       jtbl_kardex.getTableHeader().setBackground(Color.yellow);

       jtbl_estadisticasarticulo.getColumnModel().getColumn(0).setPreferredWidth(20);//tienda
       jtbl_estadisticasarticulo.getColumnModel().getColumn(1).setPreferredWidth(20);//clave
       jtbl_estadisticasarticulo.getColumnModel().getColumn(2).setPreferredWidth(20);//codigo
       jtbl_estadisticasarticulo.getColumnModel().getColumn(3).setPreferredWidth(60);//descripcion
       jtbl_estadisticasarticulo.getColumnModel().getColumn(4).setPreferredWidth(15);//descripcion
       jtbl_estadisticasarticulo.getColumnModel().getColumn(5).setPreferredWidth(50);//precio
       jtbl_estadisticasarticulo.getColumnModel().getColumn(6).setPreferredWidth(50);//p. rebaja
       jtbl_estadisticasarticulo.getColumnModel().getColumn(7).setPreferredWidth(40);//stock min
       jtbl_estadisticasarticulo.getColumnModel().getColumn(8).setPreferredWidth(15);//stock max
       jtbl_estadisticasarticulo.getColumnModel().getColumn(9).setPreferredWidth(15);//stock max
       jtbl_estadisticasarticulo.getColumnModel().getColumn(10).setPreferredWidth(15);//stock max
       jtbl_estadisticasarticulo.getColumnModel().getColumn(11).setPreferredWidth(15);//stock max
       jtbl_estadisticasarticulo.getColumnModel().getColumn(12).setPreferredWidth(15);//stock max
       jtbl_estadisticasarticulo.getColumnModel().getColumn(13).setPreferredWidth(50);//stock max
       jtbl_estadisticasarticulo.getColumnModel().getColumn(14).setPreferredWidth(50);//stock max

       jtb_catalogo_derivadas.getColumnModel().getColumn(0).setPreferredWidth(30);//tienda
       jtb_catalogo_derivadas.getColumnModel().getColumn(1).setPreferredWidth(60);//clave
       jtb_catalogo_derivadas.getColumnModel().getColumn(2).setPreferredWidth(180);//codigo
       jtb_catalogo_derivadas.getColumnModel().getColumn(3).setPreferredWidth(30);//descripcion
       jtb_catalogo_derivadas.getColumnModel().getColumn(4).setPreferredWidth(30);//precio
       jtb_catalogo_derivadas.getColumnModel().getColumn(5).setPreferredWidth(30);//p. rebaja
       jtb_catalogo_derivadas.getColumnModel().getColumn(6).setPreferredWidth(50);//stock min

       jtbl_articulosentiendas.getColumnModel().getColumn(0).setPreferredWidth(40);//tienda
       jtbl_articulosentiendas.getColumnModel().getColumn(1).setPreferredWidth(10);//clave
       jtbl_articulosentiendas.getColumnModel().getColumn(2).setPreferredWidth(65);//codigo
       jtbl_articulosentiendas.getColumnModel().getColumn(3).setPreferredWidth(30);//descripcion
       jtbl_articulosentiendas.getColumnModel().getColumn(4).setPreferredWidth(120);//precio
       jtbl_articulosentiendas.getColumnModel().getColumn(5).setPreferredWidth(60);//p. rebaja
       jtbl_articulosentiendas.getColumnModel().getColumn(6).setPreferredWidth(20);//stock min
       jtbl_articulosentiendas.getColumnModel().getColumn(7).setPreferredWidth(20);//p. rebaja
       jtbl_articulosentiendas.getColumnModel().getColumn(8).setPreferredWidth(20);//stock min
       jtbl_articulosentiendas.getColumnModel().getColumn(9).setPreferredWidth(20);//p. rebaja
       jtbl_articulosentiendas.getColumnModel().getColumn(10).setPreferredWidth(20);//stock min
       jtbl_articulosentiendas.getColumnModel().getColumn(11).setPreferredWidth(20);//stock min
       jtbl_articulosentiendas.getColumnModel().getColumn(12).setPreferredWidth(20);//Ultimo Costo
       jtbl_articulosentiendas.getColumnModel().getColumn(13).setPreferredWidth(20);//Ultimo Costo
       jtbl_articulosentiendas.getColumnModel().getColumn(14).setPreferredWidth(20);//Ultimo Costo

       jtbl_kardex1.getColumnModel().getColumn(0).setPreferredWidth(80);//Tienda
       jtbl_kardex1.getColumnModel().getColumn(1).setPreferredWidth(30);//Id mov
       jtbl_kardex1.getColumnModel().getColumn(2).setPreferredWidth(80);//Fecha
       jtbl_kardex1.getColumnModel().getColumn(3).setPreferredWidth(160);//movimiento
       jtbl_kardex1.getColumnModel().getColumn(4).setPreferredWidth(30);//ref
       jtbl_kardex1.getColumnModel().getColumn(5).setPreferredWidth(80);//articulo
       jtbl_kardex1.getColumnModel().getColumn(6).setPreferredWidth(40);//precio
       jtbl_kardex1.getColumnModel().getColumn(7).setPreferredWidth(40);//cli/mov
       jtbl_kardex1.getColumnModel().getColumn(8).setPreferredWidth(40);//cantidad
       jtbl_kardex1.getColumnModel().getColumn(9).setPreferredWidth(40);//cantidad

       jtbl_kardex2.getColumnModel().getColumn(0).setPreferredWidth(80);//Tienda
       jtbl_kardex2.getColumnModel().getColumn(1).setPreferredWidth(30);//Id mov
       jtbl_kardex2.getColumnModel().getColumn(2).setPreferredWidth(80);//Fecha
       jtbl_kardex2.getColumnModel().getColumn(3).setPreferredWidth(160);//movimiento
       jtbl_kardex2.getColumnModel().getColumn(4).setPreferredWidth(30);//ref
       jtbl_kardex2.getColumnModel().getColumn(5).setPreferredWidth(80);//articulo
       jtbl_kardex2.getColumnModel().getColumn(6).setPreferredWidth(40);//precio
       jtbl_kardex2.getColumnModel().getColumn(7).setPreferredWidth(40);//cli/mov
       jtbl_kardex2.getColumnModel().getColumn(8).setPreferredWidth(40);//cantidad
       jtbl_kardex2.getColumnModel().getColumn(9).setPreferredWidth(40);//cantidad

       jtbl_estadisticasarticulo.getTableHeader().setBackground(Color.yellow);

        //jtb_catalogo_distribucionalma.getTableHeader().setPreferredSize(new Dimension(jtb_catalogo_distribucionalma.getTableHeader().getWidth(),60));
        this.loadcombotempoventas();
        controlcombotv=1;
        this.loadcombolineaarticulo();
        controlcombola=1;
        this.loadcombotementrada();
        controlcombote=1;
        this.setTitle("Modulo Articulos: Consultando y Actualizando Datos.("+this.jtf_clave.getText()+":"+this.jtf_descripcion.getText()+")");
        this.jtf_tiendausuario.setText(String.valueOf(variables_global.getidtiendami()));

    }

      private void loadcombotempoventas(){


            try
            {
                rs = x.sieuno_executediversosv2("select * from x1sieuno_articulo_temporadas_venta() as (id smallint,descrip character varying(25));",variables_global.getconexiongral());
               while (rs.next())
                    {
                      this.jcbx_temporadasventa.addItem(rs.getString("id")+":"+rs.getString("descrip"));
                    }
             }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
    }
 private void loadcombolineaarticulo(){


            try
            {
                rs = x.sieuno_executediversosv2("select * from x1sieuno_articulo_lineas_articulo() as (id smallint,descrip character varying(25));",variables_global.getconexiongral());
               while (rs.next())
                    {
                      this.jcbx_lineaarti.addItem(rs.getString("id")+":"+rs.getString("descrip"));
                    }
             }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
    }

 private void loadcombotementrada()
 {

            try
            {
               rs = x.sieuno_executediversosv2("select * from x1sieuno_articulo_temporadas() as (id smallint,descrip character varying(25));",variables_global.getconexiongral());
               while (rs.next())
                    {
                      this.jcbx_tementrada.addItem(rs.getString("id")+":"+rs.getString("descrip"));
                    }
             }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
    }

private void iniciar_modelo_de_tabla()
        {
        jtable_modelo=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo.addColumn("<html><BODY><b>Tienda</b></BODY></html>");
        jtable_modelo.addColumn("<html><BODY><b>Id</b></BODY></html>");
        jtable_modelo.addColumn("<html><BODY><b>Clave</b></BODY></html>");
        jtable_modelo.addColumn("<html><BODY><b>Codigo</b></BODY></html>");
        jtable_modelo.addColumn("<html><BODY><b>Descripcion</b></BODY></html>");
        jtable_modelo.addColumn("<html><BODY><b>Item</b></BODY></html>");
        jtable_modelo.addColumn("<html><BODY><b>Precio</b></BODY></html>");
        jtable_modelo.addColumn("<html><BODY><b>P.Reb</b></BODY></html>");
        jtable_modelo.addColumn("<html><BODY><b>P.May</b></BODY></html>");
        jtable_modelo.addColumn("<html><BODY><b>Stock Min</b></BODY></html>");
        jtable_modelo.addColumn("<html><BODY><b>Stock max</b></BODY></html>");
        jtable_modelo.addColumn("<html><BODY><b>E.Tienda</b></BODY></html>");
        jtable_modelo.addColumn("<html><BODY><b>E.Bodega</b></BODY></html>");
        jtable_modelo.addColumn("<html><BODY><b>E.Total</b></BODY></html>");
        jtable_modelo.addColumn("<html><BODY><b>Ult.Costo</b></BODY></html>");
     }
private void iniciar_modelo_articuloestadistica()
 {
        jtable_modelo_estadisticas=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_estadisticas.addColumn("<html><BODY><b>Tienda</b></BODY></html>");
        jtable_modelo_estadisticas.addColumn("<html><BODY><b>C.Surt</b></BODY></html>");
        jtable_modelo_estadisticas.addColumn("<html><BODY><b>Pzas E.</b></BODY></html>");
        jtable_modelo_estadisticas.addColumn("<html><BODY><b>F.u.Compra</b></BODY></html>");
        jtable_modelo_estadisticas.addColumn("<html><BODY><b>P.Vend</b></BODY></html>");
        jtable_modelo_estadisticas.addColumn("<html><BODY><b>f.P.Venta</b></BODY></html>");
        jtable_modelo_estadisticas.addColumn("<html><BODY><b>f.U.Venta</b></BODY></html>");
        jtable_modelo_estadisticas.addColumn("<html><BODY><b>Vendido En</b></BODY></html>");
        jtable_modelo_estadisticas.addColumn("<html><BODY><b>Precio</b></BODY></html>");
        jtable_modelo_estadisticas.addColumn("<html><BODY><b>P.Rebaja</b></BODY></html>");
        jtable_modelo_estadisticas.addColumn("<html><BODY><b>E.Min</b></BODY></html>");
        jtable_modelo_estadisticas.addColumn("<html><BODY><b>E.max</b></BODY></html>");
        jtable_modelo_estadisticas.addColumn("<html><BODY><b>Exist.</b></BODY></html>");
        jtable_modelo_estadisticas.addColumn("<html><BODY><b>F.a.Traspaso</b></BODY></html>");
        jtable_modelo_estadisticas.addColumn("<html><BODY><b>F.a.Promocion</b></BODY></html>");

}
private void iniciar_modelo_articuloventaxmes()
 {
        jtable_modelo_ventamensual=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_ventamensual.addColumn("<html><BODY><b>Mes</b></BODY></html>");
        jtable_modelo_ventamensual.addColumn("<html><BODY><b>Clave</b></BODY></html>");
        jtable_modelo_ventamensual.addColumn("<html><BODY><b>Piezas</b></BODY></html>");
        jtable_modelo_ventamensual.addColumn("<html><BODY><b>Importe Costo</b></BODY></html>");
        jtable_modelo_ventamensual.addColumn("<html><BODY><b>Importe Venta</b></BODY></html>");
        jtable_modelo_ventamensual.addColumn("<html><BODY><b>Utilidad</b></BODY></html>");
}
private void iniciar_modelo_invefisicohistorial()
    {
        System.out.println("1EN INVE FISICO HISTORIAL");
        jtable_modelo_ifh=new javax.swing.table.DefaultTableModel();//Creo el modelo
        System.out.println("2EN INVE FISICO HISTORIAL");
        jtable_modelo_ifh.addColumn("Tienda");
        System.out.println("3EN INVE FISICO HISTORIAL");
        jtable_modelo_ifh.addColumn("Familia");
        jtable_modelo_ifh.addColumn("Sub_fam");
        jtable_modelo_ifh.addColumn("inv.fis");
        jtable_modelo_ifh.addColumn("Clave");
        jtable_modelo_ifh.addColumn("Descripcion");
        jtable_modelo_ifh.addColumn("Item");
        jtable_modelo_ifh.addColumn("Teorica");
        jtable_modelo_ifh.addColumn("Fisica");
        jtable_modelo_ifh.addColumn("Diferencia");
        System.out.println("4EN INVE FISICO HISTORIAL");
        jtable_modelo_ifh.addColumn("Fecha");
    }
private void iniciar_modelo_articulofisicohistorial()
    {
        System.out.println("EN FISICOHITORIAL");
        jtable_modelo_Artihistorifisico=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_Artihistorifisico.addColumn("Folio");
        jtable_modelo_Artihistorifisico.addColumn("Descripcion");
        jtable_modelo_Artihistorifisico.addColumn("Fecha");
        jtable_modelo_Artihistorifisico.addColumn("Hora");
        jtable_modelo_Artihistorifisico.addColumn("Realizo");
        jtable_modelo_Artihistorifisico.addColumn("superviso");
        jtable_modelo_Artihistorifisico.addColumn("Clave");
        jtable_modelo_Artihistorifisico.addColumn("Descripcion");
        jtable_modelo_Artihistorifisico.addColumn("Cantidad");
    }
private void iniciar_modelo_distribucionalma()
    {
        System.out.println("EN distribucionalma");
        jtable_modelo_distribucionalma=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_distribucionalma.addColumn("Folio/Almacenes");
        String texto="select * from x1distribucion_terminados_distribucion_clientes() as (id smallint,idcleinte character varying(12),ordenvisua smallint,clientenombre character varying(60));";
        System.out.println(texto);
           try
            {
               rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
               while (rs.next())
                    {
                          jtable_modelo_distribucionalma.addColumn("<html><b>"+rs.getString("idcleinte")+":"+rs.getString("clientenombre")+"</b></html>");
                    }
             }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
        jtable_modelo_distribucionalma.addColumn("Total");
    }

private void iniciar_modelo_kardex()
 {
        jtable_modelo_kardex=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_kardex.addColumn("<html><BODY><b>Tienda</b></BODY></html>");
        jtable_modelo_kardex.addColumn("<html><BODY><b>id movi</b></BODY></html>");
        jtable_modelo_kardex.addColumn("<html><BODY><b>Fecha</b></BODY></html>");
        jtable_modelo_kardex.addColumn("<html><BODY><b>Movimiento</b></BODY></html>");
        jtable_modelo_kardex.addColumn("<html><BODY><b>Ref.</b></BODY></html>");
        jtable_modelo_kardex.addColumn("<html><BODY><b>Articulo</b></BODY></html>");
        jtable_modelo_kardex.addColumn("<html><BODY><b>P.Publico</b></BODY></html>");
        jtable_modelo_kardex.addColumn("<html><BODY><b>clie/prov</b></BODY></html>");
        jtable_modelo_kardex.addColumn("<html><BODY><b>Cantidad</b></BODY></html>");
        jtable_modelo_kardex.addColumn("<html><BODY><b>Historial</b></BODY></html>");
}
private void iniciar_modelo_submodelos()
 {
        System.out.println("EN SUBMODELOS");
        jtable_modelo_clavesderivadas=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_clavesderivadas.addColumn("<html><BODY><b>id</b></BODY></html>");
        jtable_modelo_clavesderivadas.addColumn("<html><BODY><b>Clave</b></BODY></html>");
        jtable_modelo_clavesderivadas.addColumn("<html><BODY><b>Descripcion</b></BODY></html>");
        jtable_modelo_clavesderivadas.addColumn("<html><BODY><b>Item</b></BODY></html>");
        jtable_modelo_clavesderivadas.addColumn("<html><BODY><b>Costo</b></BODY></html>");
        jtable_modelo_clavesderivadas.addColumn("<html><BODY><b>Precio</b></BODY></html>");
        jtable_modelo_clavesderivadas.addColumn("<html><BODY><b>Clave Base</b></BODY></html>");
}
private void iniciar_modelo_kardex_derivadadistribucion()
 {
        System.out.println("EN DERIVADOS");
        jtable_modelo_kardex_deridestribucion=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_kardex_deridestribucion.addColumn("<html><BODY><b>Tienda</b></BODY></html>");
        jtable_modelo_kardex_deridestribucion.addColumn("<html><BODY><b>id movi</b></BODY></html>");
        jtable_modelo_kardex_deridestribucion.addColumn("<html><BODY><b>Fecha</b></BODY></html>");
        jtable_modelo_kardex_deridestribucion.addColumn("<html><BODY><b>Movimiento</b></BODY></html>");
        jtable_modelo_kardex_deridestribucion.addColumn("<html><BODY><b>Ref.</b></BODY></html>");
        jtable_modelo_kardex_deridestribucion.addColumn("<html><BODY><b>Articulo</b></BODY></html>");
        jtable_modelo_kardex_deridestribucion.addColumn("<html><BODY><b>P.Publico</b></BODY></html>");
        jtable_modelo_kardex_deridestribucion.addColumn("<html><BODY><b>clie/prov</b></BODY></html>");
        jtable_modelo_kardex_deridestribucion.addColumn("<html><BODY><b>Cantidad</b></BODY></html>");
        jtable_modelo_kardex_deridestribucion.addColumn("<html><BODY><b>Historial</b></BODY></html>");
}
private void iniciar_modelo_kardexb()
 {
        jtable_modelo_kardexb=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_kardexb.addColumn("<html><BODY><b>Tienda</b></BODY></html>");
        jtable_modelo_kardexb.addColumn("<html><BODY><b>id movi</b></BODY></html>");
        jtable_modelo_kardexb.addColumn("<html><BODY><b>Fecha</b></BODY></html>");
        jtable_modelo_kardexb.addColumn("<html><BODY><b>Movimiento</b></BODY></html>");
        jtable_modelo_kardexb.addColumn("<html><BODY><b>Ref.</b></BODY></html>");
        jtable_modelo_kardexb.addColumn("<html><BODY><b>Articulo</b></BODY></html>");
        jtable_modelo_kardexb.addColumn("<html><BODY><b>Precop</b></BODY></html>");
        jtable_modelo_kardexb.addColumn("<html><BODY><b>clie/prov</b></BODY></html>");
        jtable_modelo_kardexb.addColumn("<html><BODY><b>Cantidad</b></BODY></html>");
        jtable_modelo_kardexb.addColumn("<html><BODY><b>Historial</b></BODY></html>");
}

private int findcolumna_idtienda (String titulo)  {
  int columnas = jtable_modelo_distribucionalma.getColumnCount(),columencontrado=0;
  String columtitulo[]=null;
      for(int j = 0 ;j < columnas ; j++)
                {
                    columtitulo= jtable_modelo_distribucionalma.getColumnName(j).replace("<html><b>","").split(":");
                     System.out.println("Busqueda:"+columtitulo[0]+" "+titulo);
                    if(columtitulo[0].equals(titulo))
                        {
                            columencontrado=j;
                             System.out.println(titulo+" "+columtitulo[0]+" "+columencontrado);
                        }
                }
    return columencontrado;
}
private void crea_hoja_distribucionalmacen(String mes,String cantidad,int columna)
    {
        DecimalFormat miformat = new DecimalFormat("###,###,###");
        int numerofilas=this.jtable_modelo_distribucionalma.getRowCount();
        String idstat="";
        int numerocolumnas=this.jtable_modelo_distribucionalma.getColumnCount(),ii=00;
        int encontrado=0;
        Object[] fnewRow = new Object[numerocolumnas];
        float cantifam=0;
       //invoco al metodo que trae el recordset de datos
        cantifam=Float.valueOf(cantidad);
        for( ii=0;ii<numerofilas;ii++)
                {
                    idstat=jtable_modelo_distribucionalma.getValueAt(ii, 0).toString();
                    System.out.println("Agregando:"+cantidad+" "+mes);
                    if (idstat.equals(mes))
                        {
                            encontrado=1;
                            jtable_modelo_distribucionalma.setValueAt(miformat.format(cantifam),ii ,columna);
                        }
                }
       if(encontrado==0)
            {
            fnewRow[0]=mes;
            for( ii=1;ii<numerocolumnas;ii++)
                {
                               System.out.println(mes);
                               if(ii==columna)
                                    {
                                        fnewRow[ii]=miformat.format(cantifam);
                                    }
                               else
                                    {
                                        fnewRow[ii]="0";
                                    }
                }
             jtable_modelo_distribucionalma.addRow(fnewRow);
           }
    }
private void carga_datos_general(int opcion,String id)
{
     Object[] fnewRow = new Object[7],fnewRowg = new Object[15];
     DecimalFormat miformat = new DecimalFormat("#########.####");
     String texto="select * from x1sieuno_articulo_catalogov2("+opcion+",1,'"+id+"') as (id integer, cla character varying(16),cod character varying(16), des character varying(80), ultcosto numeric,fa integer,sub integer,it character varying(80),pre numeric, fe date, tei smallint,tev smallint,idlineaarti smallint,controalma character varying(20),id_status smallint,unidadempaque character varying(8), idsublin smallint,ob character varying(80),nomfa character varying(30), nomsub character varying(50),tementr character varying(25),descriplinea character varying(25),descripstatus character varying(25),descripsublinea character varying(25),describetemventa character varying(25),clavebase character varying(16))";
     int banderafin=0;
     try
        {
            System.out.println(texto);
            rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
            while (rs.next())
                {
                    banderafin=1;
                    this.jtf_id.setText(rs.getString ("id"));
                    this.jtf_clave.setText(rs.getString ("cla"));
                    this.jtf_clave_estadistica.setText(rs.getString ("cla"));
                    this.jtf_codigobarras.setText(rs.getString ("cod"));
                    this.jtf_descripcion.setText(rs.getString ("des"));
                    this.jtf_descripcion_estadistica.setText(rs.getString ("des"));
                    this.jtf_ultcosto.setText(miformatd.format(rs.getFloat("ultcosto")));
                    this.jtf_costo.setText(miformat.format(rs.getFloat("ultcosto")));
                    this.jtf_item.setText(rs.getString("it"));
                    this.jtf_invecontitem.setText(rs.getString("it"));
                    this.jtf_precio.setText(miformat.format(rs.getFloat("pre")));
                    this.jtf_fechaultima.setText(this.fechaeuropea(rs.getString ("fe")));
                    this.jtf_idfam.setText(rs.getString("fa"));
                    this.jtf_familia.setText(rs.getString("nomfa"));
                    this.jtf_idsubfam.setText(rs.getString("sub"));
                    this.jtf_subfamilia.setText(rs.getString("nomsub"));

                    this.jcbx_tementrada.addItem(rs.getString ("tei")+":"+rs.getString ("tementr"));
                    //this.jtf_idtementrada.setText(rs.getString ("tei"));
                    //this.jtf_tementrada.setText(rs.getString ("tementr"));
                    this.jcbx_temporadasventa.addItem(rs.getString ("tev")+":"+rs.getString ("describetemventa"));
                    //this.jtf_idlinea.setText(rs.getString ("idlineaarti"));
                    //this.jtf_lineaarticulo.setText(rs.getString ("descriplinea"));
                    this.jcbx_lineaarti.addItem(rs.getString("idlineaarti")+":"+rs.getString("descriplinea"));
                    this.jtf_controlalmacen.setText(rs.getString ("controalma"));
                    this.jtf_idsublinea.setText(rs.getString ("idsublin"));
                    this.jtf_sublineadescribe.setText(rs.getString ("descripsublinea"));
                    this.jtf_idstatus.setText(rs.getString ("id_status"));
                    this.jtf_describestatus.setText(rs.getString ("descripstatus"));
                    this.jta_observacion.setText(rs.getString ("ob"));
                    this.jep_articuloimagen.setText("<img src=\"http://"+variables_global.getHostfotos()+"/"+variables_global.getcarpetaaplicacion()+"/fotos/"+rs.getString ("cla")+".JPG\" width=\"410\" height=\"290\" border=\"0\" alt=\"Foto Articulo\"></img>");
                    this.jep_articuloimagenestadistica.setText("<img src=\"http://"+variables_global.getHostfotos()+"/"+variables_global.getcarpetaaplicacion()+"/fotos/"+rs.getString ("cla")+".JPG\" width=\"115\" height=\"102\" border=\"0\" alt=\"Foto Articulo\"></img>");
                    this.jtf_unidadempaque.setText(rs.getString ("unidadempaque"));
                    this.jtf_idclavebase.setText(rs.getString("clavebase"));
                    fnewRow[0]=rs.getString ("id");
                    fnewRow[1]=rs.getString ("cla");
                    fnewRow[2]=rs.getString ("des");
                    fnewRow[3]=rs.getString("it");
                    fnewRow[4]=miformat.format(rs.getFloat("ultcosto"));
                    fnewRow[5]=miformat.format(rs.getFloat("pre"));
                    fnewRow[6]=rs.getString("clavebase");
                    jtable_modelo_clavesderivadas.addRow(fnewRow);

                    fnewRowg[0]="0:General";
                    fnewRowg[1]=rs.getString ("id");
                    fnewRowg[2]=rs.getString ("cla");
                    fnewRowg[3]=rs.getString ("cod")+"";
                    fnewRowg[4]=rs.getString ("des");
                    fnewRowg[5]=rs.getString ("it");
                    fnewRowg[6]=rs.getString ("pre");
                    fnewRowg[7]="";
                    fnewRowg[8]="";
                    fnewRowg[9]="";
                    fnewRowg[10]="";
                    fnewRowg[11]="0";
                    fnewRowg[12]="0";
                    fnewRowg[13]="0";
                    fnewRowg[14]=miformat.format(rs.getFloat("ultcosto"));
                    jtable_modelo.addRow(fnewRowg);
                }
        }
        catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
     if(banderafin==0)
     {
           JOptionPane.showMessageDialog(null,"Clave:"+id+" No Encontrado", "Sistema Integral(Modificar articulo) : Ayuda",1);
     }
}

private void carga_datos_distribucionalma(String idarticulo)
    {
       String fechaeuro="";
       int columnatitulo=0;
       String mespartido="";
        int ncol=this.jtable_modelo_distribucionalma.getColumnCount();
       Object[] fnewRow = new Object[ncol];
        rs = x.sieuno_executediversosv2("select * from x1distribucion_terminados_articulos_distribucion(1,'"+idarticulo+"',1) as (folio integer,fechamov date,tipomovinve smallint,referenciainve character varying(16),fechareferencia date,clave_clie_prov character varying(16),idarticuloinve character varying(16),cantidadinve numeric,precioinve numeric,costoinve numeric,observainve character varying(80),almacen smallint,folioref smallint,submodelo character varying(4));",variables_global.getconexiongral());
        try
        {
            while (rs.next())
                {
                        mespartido=rs.getString("clave_clie_prov");
                        columnatitulo=this.findcolumna_idtienda(mespartido);
                        this.crea_hoja_distribucionalmacen(rs.getString("referenciainve")+"("+this.fechaeuropea(rs.getString("fechareferencia"))+")",rs.getString("cantidadinve").replace("-", ""),columnatitulo);
                }
        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }
     fnewRow[0]="Totales:";
     jtable_modelo_distribucionalma.addRow(fnewRow);
     this.contruir_totales_distribucionalma();
     }
private void contruir_totales_distribucionalma()
    {
         DecimalFormat myFormatter = new DecimalFormat("###,###,###");
         float totalve=0,totgeneral=0;
         int totalfilasreporte=this.jtable_modelo_distribucionalma.getRowCount()-1,i=0,ii=0;
         int numerotiendas=this.jtable_modelo_distribucionalma.getColumnCount()-2;
         //genero los totales por tienda
          System.out.println("aqui ta chingando la madre"+numerotiendas);
         for( ii=0;ii<numerotiendas;ii++)
            {
             totalve=0;
                for(i=0;i<totalfilasreporte;i++)
                    {
                        totalve+=Float.valueOf(jtable_modelo_distribucionalma.getValueAt(i, ii+1).toString().replace(",","").replace(".",""));
                    }
                    jtable_modelo_distribucionalma.setValueAt("<html><h3><b>"+myFormatter.format(totalve)+"</b></h3></html>",i,ii+1);
                    totgeneral+=totalve;
            }
           totalve=0;
           for(i=0;i<totalfilasreporte;i++)
                  {
                        totalve=0;
                        for( ii=0;ii<numerotiendas;ii++)
                        {
                            totalve+=Float.valueOf(jtable_modelo_distribucionalma.getValueAt(i, ii+1).toString().replace(",","").replace(".",""));
                        }
                        jtable_modelo_distribucionalma.setValueAt("<html><h3><b>"+myFormatter.format(totalve)+"</b></h3></html>",i,ii+1);
                  }
           totalve=0;
           Object[] fnewRow = new Object[numerotiendas+2];
           fnewRow[0]="%";
           for( ii=0;ii<numerotiendas;ii++)
               {
                    totalve=Float.valueOf(jtable_modelo_distribucionalma.getValueAt(totalfilasreporte, ii+1).toString().replace(",","").replace(".","").replace("<html><h3><b>","").replace("</b></h3></html>", ""));
                    fnewRow[ii+1]="<html><h3><b>"+myFormatter.format((totalve/totgeneral)*100)+"%</b></h3></html>";
               }
           jtable_modelo_distribucionalma.addRow(fnewRow);
     }
private void contruir_grafica_distribuciontotal()
    {
        //inicio a extraer los totales del dia sin incluir monedero es decir al reporte detalle corte
        //contruyo el grafico de lineas del cortes del dia detalle

         DefaultCategoryDataset datasetbarra = new DefaultCategoryDataset();
         String titulografico="",totaltiendatexto="";
         int totalfilasreporte=this.jtable_modelo_distribucionalma.getRowCount()-2,i=0,ii=0;
         int numerotiendas=this.jtable_modelo_distribucionalma.getColumnCount()-2;
         float totalve=0;
         for( ii=0;ii<numerotiendas;ii++)
            {
                System.out.println(totalfilasreporte);
                totalve=Float.valueOf(jtable_modelo_distribucionalma.getValueAt(totalfilasreporte, ii+1).toString().replace(",","").replace(".","").replace("<html><h3><b>","").replace("</b></h3></html>", ""));
                titulografico=jtable_modelo_distribucionalma.getColumnName(ii+1).replace("<html><b>","").replace("</b></html>","");
                if(totalve>0)
                    {
                        datasetbarra.addValue(totalve,titulografico,"Tiendas");
                    }
            }
       //System.out.println("se crea nuevo:");
        graficacion_varios_barras gvbtempo = new graficacion_varios_barras("Sistema Integral: Estadisticas Distribucion",datasetbarra,"Piezas Distribuidas:"+this.jtf_descripcion.getText()+" "+this.jtf_clave.getText(),"Articulo");
        gvbtempo.pack();
        RefineryUtilities.centerFrameOnScreen(gvbtempo);
        gvbtempo.setVisible(true);
        //this.jif_graficaarticulos.getParent().add(gvbtempo);
     }

private void guarda_articulo(int opcion)
       {

            if (variables_global.getnivelusu() < 3)
                {
                    float vprecio=0,vprereba,vstockmi=0,vstockma=0;
                    String vcodigo = this.jtf_tienda_codigobarra.getText().toUpperCase().trim();
                    String vdescrip = this.jtf_tienda_descrip.getText().toUpperCase().trim();
                        try{
                                vprecio = Float.valueOf(this.jtf_tienda_precioventa.getText().toString());
                            }catch (NumberFormatException nfe)
                            {
                                vprecio=0;
                            }

                            try{
                                vprereba = Float.valueOf(this.jtf_tienda_preciorebaja.getText().toString());
                           }catch (NumberFormatException nfe)
                            {
                                vprereba=0;
                            }
                            try{
                                vstockmi = Float.valueOf(this.jtf_tienda_stockmi.getText().toString());
                            }catch (NumberFormatException nfe)
                            {
                                vstockmi=0;
                            }
                            try{
                                vstockma = Float.valueOf(this.jtf_tiendastockmax.getText().toString());
                            }catch (NumberFormatException nfe)
                            {
                                vstockma=0;
                            }

                int idarti=Integer.valueOf(this.jtf_id.getText().toString());

                if( (vprecio >= 0) && (vdescrip.length() > 0))
                    {
                        String texto="select * from x1sieuno_articulo_detalle_actualiza("+opcion+","+this.jtf_idtiendadetalle.getText()+","+idarti+","+vprecio+","+vprereba+",'"+vcodigo+"','"+vdescrip+"','"+vstockmi+"','"+vstockma+"','"+this.jtf_tienda_clave.getText().trim()+"')";
                        rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                    }
                else
                    {
                        JOptionPane.showMessageDialog(null,"Verifique datos de articulo", "Sistema Integral(Agregar) : Ayuda",1);
                        this.jtf_clave.requestFocus();
                    }
            this.dispose();
        }
    else
        {
                        JOptionPane.showMessageDialog(null,"Usted No puede hacer Cambios:", "Sistema Integral(Modificar articulo) : Ayuda",1);
        }
    }
private void articulo_actualiza()
       {

    if (variables_global.getnivelusu() < 3)
        {
            int vfamilia=0,vsubfamilia;

            try{
                  vfamilia = Integer.valueOf(this.jtf_idfam.getText().toString());
               }catch (NumberFormatException nfe)
              {
                  vfamilia=0;
              }
            try{
                  vsubfamilia = Integer.valueOf(this.jtf_idsubfam.getText().toString());
               }catch (NumberFormatException nfe)
              {
                  vsubfamilia=0;
              }
            int idarti=Integer.valueOf(this.jtf_id.getText().toString());
            if( (vfamilia > 0) && (vsubfamilia > 0))
                {
                   // rs = x.damecat_art_actualiza(idarti,vcodigo,vdescrip,vprecio,vprereba,tiendasel);
                    String texto="select * from x1sieuno_articulo_inven_actualizaproducto(1,"+idarti+","+vfamilia+","+vsubfamilia+",'"+this.jtf_item.getText().trim().toUpperCase()+"','"+this.jta_observacion.getText().toString().trim().replace("\n", " ").toUpperCase()+"')";
                    rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                }
            else
                {
                    JOptionPane.showMessageDialog(null,"Verifique datos de articulo", "Sistema Integral(Actualizar) : Ayuda",1);
                    this.jtf_clave.requestFocus();
                }
            this.dispose();
        }
    else
        {
                        JOptionPane.showMessageDialog(null,"Usted No puede hacer Cambios:", "Sistema Integral(Modificar articulo) : Ayuda",1);
        }
    }

private void articulo_actualizacodigo(int opcion,String id,String idfam,String idsubfam,String valor,String observa)
    {


            int idarti=Integer.valueOf(this.jtf_id.getText().toString());

            //if ((this.jtf_codigobarras.getText().length() > 1 ) && (!this.jtf_codigobarras.getText().equals(".")))



            if (opcion==2 )
                {
                if (this.jtf_codigobarras.getText().length() > 0 )
                    {
                     if(JOptionPane.showConfirmDialog(null, "Desea Actualizar los Datos?")==0)
                            {
                                String texto="select * from x1sieuno_articulo_inven_actualizaproducto("+opcion+","+id+","+idfam+","+idsubfam+",'"+valor+"','"+observa+"')";
                                System.out.println(texto);
                                rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                                this.dispose();
                            }
                     else
                            {
                                this.jtf_idfam.requestFocus();
                            }
                    }
                 else
                  {
                    this.jtf_idfam.requestFocus();
                  }
            }
            else
                {
                       if(JOptionPane.showConfirmDialog(null, "Desea Actualizar los Datos?")==0)
                            {
                                String texto="select * from x1sieuno_articulo_inven_actualizaproducto("+opcion+","+id+","+idfam+","+idsubfam+",'"+valor+"','"+observa+"')";
                                System.out.println(texto);
                                rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                                this.dispose();
                            }
                     else
                            {
                                this.jtf_idfam.requestFocus();
                            }
                }
    }


private void carga_articulo_estadisticas(String idtienda,String idpro)
    {
            Object[] fnewRow = new Object[15];
            int diasdif=0,diasdifprimer=0,diasdifultimo=0;
            float totalexist=0;
            String idcadena[]=null;
            String texto2="select * from x1sieuno_articulo_ventas_estadisticasv3(1,0,"+idpro+") as (min integer,max integer,exi numeric,preve double precision,pre_re real,clavepro text,acumventas numeric,primerv date,ultimav date,nmovent numeric,piezasent numeric,diasvsprimerventa integer,diasvsultimaventa integer,diasenvenderse integer,fucom date,fatraspaso date,fautpromo date)";
            System.out.println(texto2);
            try
                {
                 rs = x.sieuno_executediversosv2(texto2,variables_global.getconexiongral());
                          while (rs.next())
                            {
                                    idcadena=rs.getString("clavepro").toString().split(":");
                                    diasdif=0;
                                    diasdifprimer=0;
                                    diasdifultimo=0;
                                    fnewRow[0]=idcadena[2]+":"+idcadena[1];
                                    fnewRow[1]=miformat.format(rs.getFloat("nmovent"));
                                    fnewRow[2]=miformat.format(rs.getFloat("piezasent"));
                                    if(rs.getString("fucom") != null)
                                        {
                                            fnewRow[3]="<html>"+this.fechaeuropea(rs.getString("fucom"))+"</html>";
                                        }
                                    else
                                        {
                                            fnewRow[3]="";
                                        }
                                    fnewRow[4]=miformat.format(rs.getFloat("acumventas")*-1);
                                    if(rs.getString("primerv") != null)
                                        {
                                            //diasdifprimer=this.fechasDiferenciaEnDias(this.fechadecadenaadate(rs.getString("primerv")),fechaactual);
                                            fnewRow[5]="<html>"+this.fechaeuropea(rs.getString("primerv"))+"<br>"+this.mensajetiempo(rs.getInt("diasvsprimerventa"))+"</html>";
                                            //diasdif=this.fechasDiferenciaEnDias(this.fechadecadenaadate(rs.getString("primerv")),this.fechadecadenaadate(rs.getString("ultimav")));
                                            fnewRow[7]="<html>"+this.mensajetiempodias(rs.getInt("diasenvenderse"))+"</html>";
                                        }
                                    else
                                        {
                                            fnewRow[5]="";
                                            fnewRow[7]="";
                                        }
                                    if(rs.getString("ultimav") != null)
                                        {
                                            if(rs.getFloat("exi")<=0)
                                                {
                                                fnewRow[6]="<html><font color=\"red\">"+this.fechaeuropea(rs.getString("ultimav"))+"<br>Agotado"+this.mensajetiempo(rs.getInt("diasvsultimaventa"))+"</font></html>";
                                                    //fnewRow[12]="<html><font color=\"red\">"+"Agotado"+this.mensajetiempo(diasdifultimo)+"</font></html>";
                                                }
                                            else
                                                {
                                                fnewRow[6]="<html>"+this.fechaeuropea(rs.getString("ultimav"))+"<br>"+this.mensajetiempo(rs.getInt("diasvsultimaventa"))+"</html>";
                                                }
                                        }
                                    else
                                        {
                                            fnewRow[6]="";
                                        }
                                    fnewRow[8]=miformat.format(rs.getFloat("preve"));
                                    fnewRow[9]=rs.getString("pre_re");
                                    fnewRow[10]=miformat.format(rs.getFloat("min"));
                                    fnewRow[11]=miformat.format(rs.getFloat("max"));
                                    fnewRow[12]=miformat.format(rs.getFloat("exi"));
                                    if(rs.getString("fatraspaso") != null)
                                        {
                                            fnewRow[13]="<html>"+this.fechaeuropea(rs.getString("fatraspaso"))+"</html>";
                                        }
                                    else
                                        {
                                            fnewRow[13]="";
                                        }
                                    if(rs.getString("fautpromo") != null)
                                        {
                                            fnewRow[14]="<html>"+this.fechaeuropea(rs.getString("fautpromo"))+"</html>";
                                        }
                                    else
                                        {
                                            fnewRow[14]="";
                                        }
                                    totalexist+=rs.getFloat("exi");
                                    jtable_modelo_estadisticas.addRow(fnewRow);
                            }
                }
                catch(Exception e)
                    {
                        System.out.println(e.getMessage());
                    }

       String texto="select * from x1distribucion_terminados_articulos_existencia('"+this.jtf_clave_estadistica.getText()+"') as (id character varying(16),existencia numeric)";

       try
        {
            rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
            while (rs.next())
                {
                     fnewRow[0]="09:DISTRIBUCION";
                     fnewRow[1]="0";
                     fnewRow[2]="0";
                     fnewRow[3]="0";
                     fnewRow[4]="";
                     fnewRow[5]="";
                     fnewRow[6]="";
                     fnewRow[7]="";
                     fnewRow[8]="";
                     fnewRow[9]="";
                     fnewRow[10]="";
                     fnewRow[11]="";
                     fnewRow[12]=miformat.format(rs.getFloat("existencia"));
                     fnewRow[13]="";
                     fnewRow[14]="";
                     totalexist+=rs.getFloat("existencia");
                     jtable_modelo_estadisticas.addRow(fnewRow);
                }
        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }
        this.cambiartamanofilas();
        this.jtf_totalexistencia.setText(miformat.format(totalexist));
}
 void cambiartamanofilas()
{
     //limpiar la tabla
       int numerofilas=this.jtable_modelo_estadisticas.getRowCount();
           for(int i = 0 ;i < numerofilas; i++)
                {
                   jtbl_estadisticasarticulo.setRowHeight(i, 30);
                }
}
private void carga_articulo_masvenxmes(String idpro)
{
            Object[] fnewRow = new Object[6];
            String texto2="select * from x1sieuno_articulo_ventas_estadisticas_ventamensual("+idpro+") as (fecha date,fe text,idarticulo integer,cantidadpro real,importeneto double precision,importecosto double precision,utilidad double precision)";
            try
                {
                 rs = x.sieuno_executediversosv2(texto2,variables_global.getconexiongral());
                    while (rs.next())
                            {
                                    fnewRow[0]=rs.getString("fe");
                                    fnewRow[1]=this.jtf_clave.getText();
                                    fnewRow[2]=miformat.format(rs.getFloat("cantidadpro"));
                                    fnewRow[3]=miformat.format(rs.getFloat("importecosto"));
                                    fnewRow[4]=miformat.format(rs.getFloat("importeneto"));
                                    fnewRow[5]=miformat.format(rs.getFloat("utilidad"));
                                    jtable_modelo_ventamensual.addRow(fnewRow);
                            }
                }
                catch(Exception e)
                    {
                        System.out.println(e.getMessage());
                    }
}
private void carga_articulo_kardex(String clavepro,String tienda,String idtienda)
        {
            ResultSet rs2 = null;
             while(jtable_modelo_kardex.getRowCount()>0)jtable_modelo_kardex.removeRow(0);
            Object[] fnewRow = new Object[10];
            float historial=0,nmovent=0,nmovsal=0,npiezasent=0,npiezassal=0,cantidad=0;
            String abrehtml="",cierrahtml="",htmlcolor="<html><BODY bgcolor=#CC0066><font color=#CC0066>_______________</font></BODY></html>";
            String texto2="select * from x1sieuno_articulo_kardexv3("+idtienda+",0,0,'"+clavepro+"','','') as (idserial integer,idmov integer,idtabla character varying(35),idalmpro integer,idcatmovalpro integer,existencia double precision,fecha date,cantidadpro real,precioxproducto double precision,idproducto integer,claveproducto text,nombreentsal text,descripcionmovi text)";
            System.out.println(texto2);
            //select * from x1sieuno_articulo_kardex(1,0,0,'EF11Z') as (idserial integer,idmov integer,idtabla character varying(35),idalmpro integer,idcatmovalpro integer,existencia double precision,fecha date,cantidadpro real,precioxproducto double precision,idproducto integer,claveproducto text,nombreentsal text,descripcionmovi text)

            try
                {
                 rs2 = x.sieuno_executediversosv2(texto2,variables_global.getconexiongral());
                          while (rs2.next())
                            {

                            if(rs2.getFloat("cantidadpro")!=0 )//significa que fue entrada
                                    {
                                if(rs2.getFloat("cantidadpro") > 0 )//significa que fue entrada
                                    {
                                        nmovent++;
                                        npiezasent+=rs2.getFloat("cantidadpro");
                                        abrehtml="<html><BODY><b>";
                                        cierrahtml="</b></BODY></html>";
                                        cantidad=rs2.getFloat("cantidadpro");
                                    }
                                else
                                    {
                                        nmovsal++;
                                        npiezassal+=rs2.getFloat("cantidadpro");
                                        abrehtml="";
                                        cierrahtml="";
                                        cantidad=rs2.getFloat("cantidadpro");
                                    }
                                        fnewRow[0]=abrehtml+tienda+cierrahtml;
                                        fnewRow[1]=abrehtml+rs2.getString ("idserial")+cierrahtml;
                                        fnewRow[2]=abrehtml+this.fechaeuropea(rs2.getString ("fecha"))+" "+this.DiaSemana(this.fechaeuropea(rs2.getString ("fecha"))).substring(0, 3)+cierrahtml;
                                        fnewRow[3]=abrehtml+rs2.getString ("idcatmovalpro")+":"+rs2.getString ("descripcionmovi")+cierrahtml;

                                        fnewRow[4]="";
                                        fnewRow[5]=abrehtml+rs2.getString ("claveproducto")+cierrahtml;
                                        fnewRow[6]=abrehtml+miformat.format(rs2.getFloat("precioxproducto"))+cierrahtml;
                                        fnewRow[7]="";
                                        fnewRow[8]=abrehtml+miformat.format(cantidad)+cierrahtml;
                                        fnewRow[9]=abrehtml+rs2.getString ("existencia")+cierrahtml;

                                historial=rs2.getFloat("existencia");
                                jtable_modelo_kardex.addRow(fnewRow);
                            }
                         }//cierra el while
                }
                catch(Exception e)
                    {
                        System.out.println(e.getMessage());
                    }

                    fnewRow[0]=htmlcolor;
                    fnewRow[1]=htmlcolor;
                    fnewRow[2]=htmlcolor;
                    fnewRow[3]=htmlcolor;
                    fnewRow[4]=htmlcolor;
                    fnewRow[5]=htmlcolor;
                    fnewRow[6]=htmlcolor;
                    fnewRow[7]=htmlcolor;
                    fnewRow[8]=htmlcolor;
                    fnewRow[9]=htmlcolor;
                    jtable_modelo_kardex.addRow(fnewRow);
                     if(nmovent  > 0 )
                                    {
                                        fnewRow[0]="";
                                        fnewRow[1]="";
                                        fnewRow[2]="Totales";
                                        fnewRow[3]="<html><BODY><b>"+"Entrada="+miformat.format(nmovent)+"</b></BODY></html>";

                                        fnewRow[4]="";
                                        fnewRow[5]="";
                                        fnewRow[6]="";
                                        fnewRow[7]="";
                                        fnewRow[8]="<html><BODY><b>"+"Piezas="+miformat.format(npiezasent)+"</b></BODY></html>";
                                        fnewRow[9]="";
                                        jtable_modelo_kardex.addRow(fnewRow);
                                    }
                     if(nmovsal  > 0 )
                                    {
                                        fnewRow[0]="";
                                        fnewRow[1]="";
                                        fnewRow[2]="Totales";
                                        fnewRow[3]="<html><BODY><b>"+"Salidas="+miformat.format(nmovsal)+"</b></BODY></html>";

                                        fnewRow[4]="";
                                        fnewRow[5]="";
                                        fnewRow[6]="";
                                        fnewRow[7]="";
                                        fnewRow[8]="<html><BODY><b>"+"Piezas="+miformat.format(npiezassal)+"</b></BODY></html>";
                                        fnewRow[9]="";
                                        jtable_modelo_kardex.addRow(fnewRow);
                                    }

           
     }
private void carga_articulo_kardexb(String clavepro,String tienda,String idtienda)
        {
            ResultSet rs2 = null;
             while(jtable_modelo_kardexb.getRowCount()>0)jtable_modelo_kardexb.removeRow(0);
            Object[] fnewRow = new Object[10];
            float historial=0,nmovent=0,nmovsal=0,npiezasent=0,npiezassal=0,cantidad=0;
            String abrehtml="",cierrahtml="",htmlcolor="<html><BODY bgcolor=#CC0066><font color=#CC0066>_______________</font></BODY></html>";
            String texto2="select * from x1sieuno_articulo_kardexv3("+idtienda+",10,0,'"+clavepro+"','','') as (idserial integer,idmov integer,idtabla character varying(35),idalmpro integer,idcatmovalpro integer,existencia double precision,fecha date,cantidadpro real,precioxproducto double precision,idproducto integer,claveproducto text,nombreentsal text,descripcionmovi text)";
            System.out.println(texto2);
            //select * from x1sieuno_articulo_kardex(1,0,0,'EF11Z') as (idserial integer,idmov integer,idtabla character varying(35),idalmpro integer,idcatmovalpro integer,existencia double precision,fecha date,cantidadpro real,precioxproducto double precision,idproducto integer,claveproducto text,nombreentsal text,descripcionmovi text)

            try
                {
                        rs2 = x.sieuno_executediversosv2(texto2,variables_global.getconexiongral());
                        while (rs2.next())
                            {
                            if(rs2.getFloat("cantidadpro")!=0 )//significa que fue entrada
                                    {
                                if(rs2.getFloat("cantidadpro") > 0)//significa que fue entrada
                                    {
                                        nmovent++;
                                        npiezasent+=rs2.getFloat("cantidadpro");
                                        abrehtml="<html><BODY><b>";
                                        cierrahtml="</b></BODY></html>";
                                        cantidad=rs2.getFloat("cantidadpro");
                                        System.out.println(rs2.getFloat("cantidadpro")+" Este es negativo");
                                    }
                                else
                                    {
                                        nmovsal++;
                                        npiezassal+=rs2.getFloat("cantidadpro");
                                        abrehtml="";
                                        cierrahtml="";
                                       cantidad=rs2.getFloat("cantidadpro");
                                     }
                                        fnewRow[0]=abrehtml+tienda+cierrahtml;
                                        fnewRow[1]=abrehtml+rs2.getString ("idserial")+cierrahtml;
                                        fnewRow[2]=abrehtml+this.fechaeuropea(rs2.getString ("fecha"))+" "+this.DiaSemana(this.fechaeuropea(rs2.getString ("fecha"))).substring(0, 3)+cierrahtml;
                                        fnewRow[3]=abrehtml+rs2.getString ("idcatmovalpro")+":"+rs2.getString ("descripcionmovi")+cierrahtml;

                                        fnewRow[4]="";
                                        fnewRow[5]=abrehtml+rs2.getString ("claveproducto")+cierrahtml;
                                        fnewRow[6]=abrehtml+miformat.format(rs2.getFloat("precioxproducto"))+cierrahtml;
                                        fnewRow[7]="";
                                        fnewRow[8]=abrehtml+miformat.format(cantidad)+cierrahtml;
                                        fnewRow[9]=abrehtml+rs2.getString ("existencia")+cierrahtml;

                                historial=rs2.getFloat("existencia");
                                jtable_modelo_kardexb.addRow(fnewRow);
                            }
                         }//cierra el while
                }
                catch(Exception e)
                    {
                        System.out.println(e.getMessage());
                    }

                    fnewRow[0]=htmlcolor;
                    fnewRow[1]=htmlcolor;
                    fnewRow[2]=htmlcolor;
                    fnewRow[3]=htmlcolor;
                    fnewRow[4]=htmlcolor;
                    fnewRow[5]=htmlcolor;
                    fnewRow[6]=htmlcolor;
                    fnewRow[7]=htmlcolor;
                    fnewRow[8]=htmlcolor;
                    fnewRow[9]=htmlcolor;
                    jtable_modelo_kardexb.addRow(fnewRow);
                     if(nmovent  > 0 )
                                    {
                                        fnewRow[0]="";
                                        fnewRow[1]="";
                                        fnewRow[2]="Totales";
                                        fnewRow[3]="<html><BODY><b>"+"Entrada="+miformat.format(nmovent)+"</b></BODY></html>";

                                        fnewRow[4]="";
                                        fnewRow[5]="";
                                        fnewRow[6]="";
                                        fnewRow[7]="";
                                        fnewRow[8]="<html><BODY><b>"+"Piezas="+miformat.format(npiezasent)+"</b></BODY></html>";
                                        fnewRow[9]="";
                                        jtable_modelo_kardexb.addRow(fnewRow);
                                    }
                     if(nmovsal  > 0 )
                                    {
                                        fnewRow[0]="";
                                        fnewRow[1]="";
                                        fnewRow[2]="Totales";
                                        fnewRow[3]="<html><BODY><b>"+"Salidas="+miformat.format(nmovsal)+"</b></BODY></html>";

                                        fnewRow[4]="";
                                        fnewRow[5]="";
                                        fnewRow[6]="";
                                        fnewRow[7]="";
                                        fnewRow[8]="<html><BODY><b>"+"Piezas="+miformat.format(npiezassal)+"</b></BODY></html>";
                                        fnewRow[9]="";
                                        jtable_modelo_kardexb.addRow(fnewRow);
                                    }

     }

private void carga_articulo_subclaves(String idclavebase)
{
            Object[] fnewRow = new Object[7];
            String texto2="select * from x1sieuno_articulo_catalogov2(11,1,'"+idclavebase+"') as (id integer,cla character varying(16),des character varying(80), ultcosto numeric,it character varying(80),pre numeric,clavebase character varying(16))";
            try
                {
                 rs = x.sieuno_executediversosv2(texto2,variables_global.getconexiongral());
                    while (rs.next())
                            {
                                if(this.jtf_clave.getText().toString().equals(rs.getString ("cla")))
                                    {
                                        //si es igual no lo agrego ya ke ya existe
                                    }
                                else
                                    {
                                        fnewRow[0]=rs.getString ("id");
                                        fnewRow[1]=rs.getString ("cla");
                                        fnewRow[2]=rs.getString ("des");
                                        fnewRow[3]=rs.getString("it");
                                        fnewRow[4]=miformat.format(rs.getFloat("ultcosto"));
                                        fnewRow[5]=miformat.format(rs.getFloat("pre"));
                                        fnewRow[6]=rs.getString("clavebase");
                                        jtable_modelo_clavesderivadas.addRow(fnewRow);
                                    }
                            }
                }
                catch(Exception e)
                    {
                        System.out.println(e.getMessage());
                    }
}

private void dioclickpakardex(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:

         int filaexis = jtbl_estadisticasarticulo.getSelectedRow();
         String valortienda[] = jtbl_estadisticasarticulo.getValueAt(filaexis, 0).toString().split(":");
         if(valortienda[0].equals("09"))
             {
                    System.out.println("dio doble  click");
                    this.carga_datos_kardexdistribucion(2,this.jtf_clave.getText().trim(),"0");
                    //this.carga_articulo_kardex(this.jtf_clave.getText().trim(), valortienda[1],valortienda[0]);
             }
         else
             {
                    this.carga_articulo_kardex(this.jtf_clave.getText().trim(), valortienda[1],valortienda[0]);
             }
    }
private void dioclickpakardex2(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:

         int filaexis =jtbl_articulosentiendas.getSelectedRow();
   if(JOptionPane.showConfirmDialog(null, "Desea ver Detalle de Kardex?")==0)
        {
            String valortienda[] =jtbl_articulosentiendas.getValueAt(filaexis, 0).toString().split(":");
            if(valortienda[0].equals("A"))
                {
                    System.out.println("dio doble  click");
                    this.carga_datos_kardexdistribucion(2,this.jtf_clave.getText().trim(),"0");
                    //this.carga_articulo_kardex(this.jtf_clave.getText().trim(), valortienda[1],valortienda[0]);
                }
            else
                {
                    this.carga_articulo_kardex(this.jtf_clave.getText().trim(), valortienda[1],valortienda[0]);
                    this.carga_articulo_kardexb(this.jtf_clave.getText().trim(), valortienda[1],valortienda[0]);
                }
        }
    }
 private void dioclickidarti(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
         System.out.println("dio doble  click");
         int fila = jtb_catalogo_articulos.getSelectedRow();
         Object valor = jtb_catalogo_articulos.getValueAt(fila, 3);
         String idcadena[]=null,foliopa="";

         idcadena = jtb_catalogo_articulos.getValueAt(fila, 0).toString().split(":");
         foliopa = jtb_catalogo_articulos.getValueAt(fila, 3).toString();
         this.carga_datos_verarticuloseninve_histori(idcadena[0],foliopa,1,this.jtf_id.getText().toString());
    }

 private void dioclickdetalletienda(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
         int fila = jtbl_articulosentiendas.getSelectedRow();
         String idcadena[]=null;
         idcadena = jtbl_articulosentiendas.getValueAt(fila, 0).toString().split(":");

        this.jtf_idtiendadetalle.setText(idcadena[0]);
        this.jtf_tienda_clave.setText(jtbl_articulosentiendas.getValueAt(fila, 2).toString());
        this.jtf_tienda_codigobarra.setText(jtbl_articulosentiendas.getValueAt(fila, 3).toString());
        this.jtf_tienda_descrip.setText(jtbl_articulosentiendas.getValueAt(fila, 4).toString());
        this.jtf_tienda_precioventa.setText(jtbl_articulosentiendas.getValueAt(fila, 6).toString());
        this.jtf_tienda_preciorebaja.setText(jtbl_articulosentiendas.getValueAt(fila, 7)+"");

        this.jtf_tienda_ite.setText(jtbl_articulosentiendas.getValueAt(fila, 5)+"");
        this.jtf_tienda_preciomayoreo.setText(jtbl_articulosentiendas.getValueAt(fila, 8)+"");

        this.jtf_tienda_stockmi.setText(jtbl_articulosentiendas.getValueAt(fila, 9)+"");
        this.jtf_tiendastockmax.setText(jtbl_articulosentiendas.getValueAt(fila, 10)+"");
        this.jtf_existencia.setText(jtbl_articulosentiendas.getValueAt(fila, 11).toString());

        this.jlbl_nombretie.setText("<html><h3>Tienda:"+idcadena[1]+"</h3></html>");

    }

private void carga_datos_kardexdistribucion(int opcion, String busqueda,String almacen)
 {
         while(jtable_modelo_kardex.getRowCount()>0)jtable_modelo_kardex.removeRow(0);
       Object[] fnewRow = new Object[11];
       float historia=0;
       String abrehtml="",cierrahtml="";

       String texto="select * from x1distribucion_terminados_articulos_kardex("+opcion+",'"+busqueda.toUpperCase().trim()+"',"+almacen+") as (folio integer,fechamov date,tipomovinve smallint,tipodescribe text,referenciainve character varying(16),fechareferencia date,clave_clie_prov character varying(12),idarticuloinve character varying(16),cantidadinve numeric,precioinve numeric,costoinve numeric,observainve character varying(80),descripcionarti character varying(80),unidadsal character varying(3),almacen smallint,describealmacen character varying(30),precio5 numeric,item character varying(20))";

       System.out.println(texto);
       try
        {
           rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
            while (rs.next())
                {
                if(rs.getFloat("cantidadinve") >0)
                            {
                                abrehtml="<html><BODY><b>";
                                cierrahtml="</b></BODY></html>";
                            }
                else
                            {
                                abrehtml="";
                                cierrahtml="";
                            }
                    historia+=rs.getFloat("cantidadinve");
                    fnewRow[0]=abrehtml+"Distribucion"+cierrahtml;
                    fnewRow[1]=abrehtml+rs.getString ("folio")+cierrahtml;
                    fnewRow[2]=abrehtml+this.fechaeuropea(rs.getString ("fechareferencia"))+" "+this.DiaSemana(this.fechaeuropea(rs.getString ("fechareferencia"))).substring(0, 3)+cierrahtml;
                    fnewRow[3]=abrehtml+rs.getString ("tipomovinve")+":"+rs.getString ("tipodescribe")+cierrahtml;
                    fnewRow[4]=abrehtml+rs.getString ("referenciainve")+cierrahtml;
                    fnewRow[5]=abrehtml+this.jtf_clave.getText()+cierrahtml;
                    fnewRow[6]=abrehtml+miformat.format(rs.getFloat("precioinve"))+cierrahtml;
                    fnewRow[7]=abrehtml+rs.getString ("clave_clie_prov")+cierrahtml;
                    fnewRow[8]=abrehtml+miformat.format(rs.getFloat("cantidadinve"))+cierrahtml;
                    fnewRow[9]=abrehtml+historia+cierrahtml;
                    jtable_modelo_kardex.addRow(fnewRow);
                }

        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }

 }
private void carga_datos_kardexdistri_idbase(int opcion, String busqueda,String almacen)
 {
       while(jtable_modelo_kardex_deridestribucion.getRowCount()>0)jtable_modelo_kardex_deridestribucion.removeRow(0);
       Object[] fnewRow = new Object[11];
       float historia=0;
       String abrehtml="",cierrahtml="";
       String texto="select * from x1distribucion_terminados_articulos_kardex("+opcion+",'"+busqueda.toUpperCase().trim()+"',"+almacen+") as (folio integer,fechamov date,tipomovinve smallint,tipodescribe text,referenciainve character varying(16),fechareferencia date,clave_clie_prov character varying(12),idarticuloinve character varying(16),cantidadinve numeric,precioinve numeric,costoinve numeric,observainve character varying(80),descripcionarti character varying(80),unidadsal character varying(3),almacen smallint,describealmacen character varying(30),precio5 numeric,item character varying(20))";

       System.out.println(texto);
       try
        {
           rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
            while (rs.next())
                {
                if(rs.getFloat("cantidadinve") >0)
                            {
                                abrehtml="<html><BODY><b>";
                                cierrahtml="</b></BODY></html>";
                            }
                else
                            {
                                abrehtml="";
                                cierrahtml="";
                            }
                    historia+=rs.getFloat("cantidadinve");
                    fnewRow[0]=abrehtml+"Distribucion"+cierrahtml;
                    fnewRow[1]=abrehtml+rs.getString ("folio")+cierrahtml;
                    fnewRow[2]=abrehtml+this.fechaeuropea(rs.getString ("fechareferencia"))+" "+this.DiaSemana(this.fechaeuropea(rs.getString ("fechareferencia"))).substring(0, 3)+cierrahtml;
                    fnewRow[3]=abrehtml+rs.getString ("tipomovinve")+":"+rs.getString ("tipodescribe")+cierrahtml;
                    fnewRow[4]=abrehtml+rs.getString ("referenciainve")+cierrahtml;
                    fnewRow[5]=abrehtml+this.jtf_clave.getText()+cierrahtml;
                    fnewRow[6]=abrehtml+rs.getString ("precioinve")+cierrahtml;
                    fnewRow[7]=abrehtml+rs.getString ("clave_clie_prov")+cierrahtml;
                    fnewRow[8]=abrehtml+rs.getString ("cantidadinve")+cierrahtml;
                    fnewRow[9]=abrehtml+historia+cierrahtml;
                    jtable_modelo_kardex_deridestribucion.addRow(fnewRow);
                }

        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }

 }



private int fechasDiferenciaEnDias(Date fechaInicial, Date fechaFinal) {

      Calendar grefechamesini = Calendar.getInstance(); // obtiene la fecha actual
       grefechamesini.set(fechaInicial.getYear()+1900,fechaInicial.getMonth(),fechaInicial.getDate());
      Calendar grefechamesfin = Calendar.getInstance(); // obtiene la fecha actual
      grefechamesfin.set(fechaFinal.getYear()+1900,fechaFinal.getMonth(),fechaFinal.getDate());

     int dias=grefechamesfin.get(Calendar.DAY_OF_YEAR)-grefechamesini.get(Calendar.DAY_OF_YEAR);
     /*
        DateFormat df = DateFormat.getDateInstance(DateFormat.MEDIUM);
        String fechaInicioString = df.format(fechaInicial);
            try {
                fechaInicial = df.parse(fechaInicioString);
                }
                catch (ParseException ex) {
                }

        String fechaFinalString = df.format(fechaFinal);
                try {
                    fechaFinal = df.parse(fechaFinalString);
                    }
                catch (ParseException ex) {
                    }

            long fechaInicialMs = fechaInicial.getTime();
            long fechaFinalMs = fechaFinal.getTime();
            long diferencia = fechaFinalMs - fechaInicialMs;
            double dias = Math.floor(diferencia / (1000 * 60 * 60 * 24));
      */
            return dias;
    }
private Date fechadecadenaadate(String fe) {
      //recibe un la fecha en strin formato yyyy-MM-dd
       String dia = "";
       java.util.Date fecha=null;
       try{
             fecha = formateadoresta.parse(fe);
          }
        catch (ParseException e){
           //Error, la cadena de texto no se puede convertir en fecha.
          }

        return fecha;
 }
private String mensajetiempo(int nd) {
     String mensaje="";
     if (nd==0)
				{
					mensaje=" Hoy ";
				}
		if (nd==1)
				{
					mensaje=" ayer ";
				}
		if (nd>1)
				{
					mensaje=" Hace " + nd + " Dias " ;
				}
     if (nd<0)
				{
					mensaje=" Vence En " + nd + " Dias " ;
				}
 	return mensaje;
 }
private String mensajetiempodias(int nd) {
     String mensaje="";
     if (nd==0)
				{
					mensaje=" Hoy ";
				}
		if (nd==1)
				{
					mensaje=" ayer ";
				}
		if (nd>1)
				{
					mensaje= nd + " Dias " ;
				}
     if (nd<0)
				{
					mensaje= nd + " Dias " ;
				}
 	return mensaje;
 }
private String  fechaamericana(String fecha) {

         //resibe cadena de fecha en formato europeo dd-MM-yyyy
        java.util.Date fechaestaeuropa=null;
       SimpleDateFormat formateadorestaamericano = new SimpleDateFormat("yyyy-MM-dd");
       String cadenafecha="";
        try
         {
          fechaestaeuropa = formateador.parse(fecha);
         }
        catch (ParseException e)
          {
             //Error, la cadena de texto no se puede convertir en fecha.
          }
       cadenafecha= formateadorestaamericano.format(fechaestaeuropa);
       return cadenafecha;

    }

private void copiar_articulo()
       {
            float vprecio=0,vcos=0,precioma=0;
            String vclave = this.jtf_clave.getText().toUpperCase().trim();
            String vdescrip = this.jtf_descripcion.getText().toUpperCase().trim();

             try{
                    vprecio = Float.valueOf(this.jtf_precio.getText().toString());
               }catch (NumberFormatException nfe)
               {
                   vprecio=0;
               }

             try{
                    vcos = Float.valueOf(this.jtf_costo.getText().toString());
               }catch (NumberFormatException nfe)
               {
                   vcos=0;
               }
            try{
                    precioma = Float.valueOf(this.jtf_tienda_preciomayoreo.getText().toString());
               }catch (NumberFormatException nfe)
               {
                   precioma=0;
               }
            String vitem = this.jtf_item.getText().toUpperCase().trim();



            if( (vprecio >= 0) && (vclave.length() > 0) && (vdescrip.length() > 0))
                {

             //       rs = x.damecat_art_addsie(vclave,".",vdescrip,vcos,vprecio,1,999,vitem,0,tiendasel);
                if( precioma > 0)
                    {
                        String texto="select * from x1sieuno_addarticulo(1,'"+vclave+"','"+this.jtf_tienda_codigobarra.getText()+"','"+vdescrip+"',"+vcos+","+vprecio+",1,999,'"+vitem+"',0,"+this.jtf_tiendausuario.getText()+",'"+precioma+"') as (status smallint)";
                        System.out.println(texto);
                        rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                    }
                else
                    {
                        String texto="select * from x1sieuno_addarticulo(2,'"+vclave+"','"+this.jtf_tienda_codigobarra.getText()+"','"+vdescrip+"',"+vcos+","+vprecio+",1,999,'"+vitem+"',0,"+this.jtf_tiendausuario.getText()+",'NULL') as (status smallint)";
                        System.out.println(texto);
                        rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                    }
                }
            else
                {
                    JOptionPane.showMessageDialog(null,"Verifique datos de articulo", "Sistema Integral(Agrear) : Ayuda",1);
                    this.jtf_clave.requestFocus();
                }


        }
private void copiar_articulob()
       {
            float vprecio=0,vcos=0,precioma=0;
            String vclave = this.jtf_clave.getText().toUpperCase().trim();
            String vdescrip = this.jtf_descripcion.getText().toUpperCase().trim();

             try{
                    vprecio = Float.valueOf(this.jtf_precio.getText().toString());
               }catch (NumberFormatException nfe)
               {
                   vprecio=0;
               }

             try{
                    vcos = Float.valueOf(this.jtf_costo.getText().toString());
               }catch (NumberFormatException nfe)
               {
                   vcos=0;
               }
            try{
                    precioma = Float.valueOf(this.jtf_tienda_preciomayoreo.getText().toString());
               }catch (NumberFormatException nfe)
               {
                   precioma=0;
               }
            String vitem = this.jtf_item.getText().toUpperCase().trim();



            if( (vprecio >= 0) && (vclave.length() > 0) && (vdescrip.length() > 0))
                {

             //       rs = x.damecat_art_addsie(vclave,".",vdescrip,vcos,vprecio,1,999,vitem,0,tiendasel);

                        String texto="select * from x1sieuno_addarticulov2(3,'"+vclave+"','"+this.jtf_tienda_codigobarra.getText()+"','"+vdescrip+"',"+vcos+","+vprecio+",1,999,'"+vitem+"',0,"+this.jtf_tiendausuario.getText()+",'NULL') as (status smallint)";
                        System.out.println(texto);
                        rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());

                }
            else
                {
                    JOptionPane.showMessageDialog(null,"Verifique datos de articulo", "Sistema Integral(Agrear) : Ayuda",1);
                    this.jtf_clave.requestFocus();
                }


        }

private  void ayuda()
            {
                String punto1="1.-Actualiza o Revisa datos de articulo,cada una de las Opciones se autodescribe brevemente\n";
                String punto2="2.- Cada Boton tiene Una letra Resaltada el cual indica su metodo abreviado, uselo si desea mayor rapides ( ejemplo Alt+a obtendra ayuda automaticamente)\n";
                String punto3="3.- Para Desplazarse en la pantalla use las teclas de acceso rapido ejemplo Alt + t o AVG PAGINA Y REPAG en el caso de las pestañas. \n ";
                JOptionPane.showMessageDialog(null,""+punto1+punto2+punto3+"", "Sistema Integral(Agregando Articulos) : Ayuda",1);
            }
private void carga_datos_articulotodaslastiendas()
        {
            String texto="select * from x1sieuno_articulo_detalle_ventasacumv2(6,"+variables_global.getidtiendami()+",'','"+this.jtf_clave.getText()+"','') as (ida integer,min integer,max integer,exi double precision,idp integer,cod text,cndt integer,descor text,preve double precision,pre_re real,clavepro text,item text,precioma real,ultimo_costo numeric)";
            System.out.println(texto);
            String despartido[]=null;
            Object[] fnewRow = new Object[15];
            DecimalFormat myForma = new DecimalFormat("############.####");
            try
               {
               rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
               while (rs.next())
                    {
                            despartido=rs.getString("descor").split(":");
                            fnewRow[0]=despartido[0]+":"+despartido[2];
                            fnewRow[1]=rs.getString("idp");
                            fnewRow[2]=rs.getString("clavepro");
                            fnewRow[3]=rs.getString("cod")+"";
                            fnewRow[4]=despartido[1];
                            fnewRow[5]=rs.getString("item");
                            fnewRow[6]=rs.getString("preve");
                            if(rs.getString("pre_re")!=null)
                                {
                                    fnewRow[7]=miformatd.format(rs.getFloat("pre_re"));
                                }
                            else
                                {
                                    fnewRow[7]="";
                                }
                            fnewRow[8]=miformatd.format(rs.getFloat("precioma"));
                            fnewRow[9]=rs.getString("min");
                            fnewRow[10]=rs.getString("max");
                            fnewRow[11]=rs.getString("exi");
                            fnewRow[12]="0";
                            fnewRow[13]="0";
                            fnewRow[14]=miformatd.format(rs.getFloat("ultimo_costo"));
                            jtable_modelo.addRow(fnewRow);

                    }
                }
            catch(Exception e)
                {
                    System.out.println(e.getMessage());
                }
             texto="select * from x1distribucion_terminados_articulos_catalogov2(1,1,'"+this.jtf_clave.getText()+"') as (id character varying(16),codbarra character varying(16),idstatus smallint,statusdescribe text,describearticulo character varying(80),describcorta character varying(20),unsal character varying(3),unent character varying(3),facentruni numeric,uniempaque character varying(12),idtempo smallint,describetemp text,idfamilia character varying(5),familiadescribe character varying(40),controlalma character varying(20),stocminimo numeric,stocmaximo numeric,precio1 numeric,precio2 numeric,precio3 numeric,precio4 numeric,precio5 numeric,ultimocosto numeric,costoprom numeric,pensurtir numeric,tiemposurtido smallint,acumprod numeric,acumimporte numeric,idtipoarticulo smallint,tipodescribe text,fechaprototipo date,fechaautoriza date,fechainiprod date,fechaultimaent date,usuario character varying(20),observacion character varying(255),idprovee character varying(12),descripprovee character varying(60),nombrecreador character varying(80),valor_x character varying(20),valorx_st character varying(20),idpersonal character varying(16),nombrepersonal character varying(80),idlinea smallint,describelinea text,existenciaf numeric,almacenlugar text,existencia numeric)";
             try
               {
               rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
               while (rs.next())
                    {

                            fnewRow[0]="A:Almacen";
                            fnewRow[1]="";
                            fnewRow[2]=rs.getString ("id");
                            fnewRow[3]=rs.getString ("codbarra")+"";
                            fnewRow[4]=rs.getString ("describearticulo");
                            fnewRow[5]=rs.getString ("valor_x")+"";
                            fnewRow[6]=rs.getString ("precio5")+"";
                            fnewRow[7]="";
                            fnewRow[8]=miformatd.format(rs.getFloat("precio2"));
                            fnewRow[9]=rs.getString ("stocminimo");
                            fnewRow[10]=rs.getString ("stocmaximo");
                            fnewRow[11]=rs.getString ("existenciaf");
                            fnewRow[12]="0";
                            fnewRow[12]="0";
                            fnewRow[13]="0";
                            fnewRow[14]=miformatd.format(rs.getFloat("ultimocosto"));
                            jtable_modelo.addRow(fnewRow);
                    }
                }
            catch(Exception e)
                {
                    System.out.println(e.getMessage());
                }
        }
private void carga_datos_articulotodaslasbodegas()
        {
            String texto="select * from x1sieuno_articulo_detalle_ventasacumv2(8,"+variables_global.getidtiendami()+",'','"+this.jtf_clave.getText()+"','') as (ida integer,min integer,max integer,exi double precision,idp integer,cod text,cndt integer,descor text,preve double precision,pre_re real,clavepro text,item text,precioma real,ultimo_costo numeric)";
            System.out.println("voy a bodega"+texto);
            String despartido[]=null,mesactual[]=null;
            int ii=0;
            DecimalFormat myForma = new DecimalFormat("###,###,###,###");
            try
               {
               rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
               while (rs.next())
                    {
                            despartido=rs.getString("descor").split(":");
                           for( ii=0;ii<this.jtable_modelo.getRowCount();ii++)
                                {
                                    mesactual=jtable_modelo.getValueAt(ii, 0).toString().split(":");
                                    // System.out.println("Agregando:"+mesactual+" "+mes);
                                    if (mesactual[0].equals(despartido[0]))
                                        {
                                            System.out.println("Tienda "+mesactual[0]+"Existencia="+rs.getString("exi"));
                                            jtable_modelo.setValueAt(rs.getString("exi"),ii ,12);
                                        }
                                }
                    }
                }
            catch(Exception e)
                {
                    System.out.println(e.getMessage());
                }

                for( ii=0;ii<this.jtable_modelo.getRowCount();ii++)
                                {
                                    jtable_modelo.setValueAt(miformatd.format(Float.valueOf(jtable_modelo.getValueAt(ii, 12).toString())+Float.valueOf(jtable_modelo.getValueAt(ii, 11).toString())),ii ,13);
                                }

        }

private void crearcomentario()
          {
                 String retorno="";

        String comentario=JOptionPane.showInputDialog("Ingresa Tu Sugerencia o Comentario:");
        if (comentario.length()>0)
        {
            rs = x.sieuno_executediversos("select * from x1distribucion_bitacorainserta('"+comentario+"', 'Articulos Edicion');");
            try
            {

               while (rs.next())
                    {
                         retorno=rs.getString(1);
                   }
             }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
            if (retorno.equals("1"))
              {
                JOptionPane.showMessageDialog(null,"Gracias Tu comentario ha sido guardado", "Sistema Integral Comentarios",1);

              }

      }
    }

private String  fechaeuropea(String fecha) {

         //resibe cadena de fecha en formato americano yyyy-MM-dd
        java.util.Date fechaestaeuropa=null;
       SimpleDateFormat formateadorestaeuropa = new SimpleDateFormat("dd-MM-yyyy");
       String cadenafecha="";
        try
         {
          fechaestaeuropa = formateadoresta.parse(fecha);
         }
        catch (ParseException e)
          {
             //Error, la cadena de texto no se puede convertir en fecha.
          }
       cadenafecha= formateadorestaeuropa.format(fechaestaeuropa);
       return cadenafecha;
    }

private String DiaSemana(String fe) {
         String dia = "";
       java.util.Date fecha=null;
         try
            {
             fecha = formateador.parse(fe);

           }
        catch (ParseException e)
            {
            //Error, la cadena de texto no se puede convertir en fecha.
            }
        Calendar cal= Calendar.getInstance();
        cal.setTime(fecha);
        //ojo para establecer o recetear cada parte de la fecha por separado
        //cal.set(Calendar.YEAR, fecha.getYear());
        //cal.set(Calendar.MONTH, fecha.getMonth());
        //cal.set(Calendar.DAY_OF_MONTH, fecha.getDay());
        int diaInt = cal.get(Calendar.DAY_OF_WEEK);
        switch (diaInt) {
            case 1:
                dia = "Domingo";
                break;
            case 2:
                dia = "Lunes";
                break;
            case 3:
                dia = "Martes";
                break;
            case 4:
                dia = "Miercoles";
                break;
            case 5:
                dia = "Jueves";
                break;
            case 6:
                dia = "Viernes";
                break;
            case 7:
                dia = "Sabado";
                break;

        }
        return dia;
    }

private void contruir_grafica_ventasxmes()
    {
        //inicio a extraer los totales del dia sin incluir monedero es decir al reporte detalle corte
        //contruyo el grafico de lineas del cortes del dia detalle

         DefaultCategoryDataset datasetbarra = new DefaultCategoryDataset();
         String titulografico="",totaltiendatexto="";
         int totalfilasreporte=this.jtbl_estadisticaventasxmes.getRowCount(),i=0,ii=0;


         for(i=0;i<totalfilasreporte;i++)
         {
             totaltiendatexto = jtbl_estadisticaventasxmes.getValueAt(i, 2).toString();
             System.out.println(totaltiendatexto);
             titulografico=jtbl_estadisticaventasxmes.getValueAt(i, 1).toString().replace("<html><p align=justify>","").replace("<br>","").replace("</p></html>", "");
             datasetbarra.addValue(Float.valueOf(totaltiendatexto.replace(",","").replace(".","")),titulografico,jtbl_estadisticaventasxmes.getValueAt(i, 0).toString().replace("<html><p align=justify>","").replace("<br>","").replace("</p></html>", ""));
         }
       //System.out.println("se crea nuevo:");
        graficacion_varios_barras gvbtempo = new graficacion_varios_barras("Sistema Integral: Estadisticas Articulo",datasetbarra,"Piezas Vendidas X Mes:"+this.jtf_descripcion.getText()+" "+this.jtf_clave.getText(),"Articulo");
        gvbtempo.pack();
        RefineryUtilities.centerFrameOnScreen(gvbtempo);
        gvbtempo.setVisible(true);
        //this.jif_graficaarticulos.getParent().add(gvbtempo);
     }
private void contruir_grafica_ventaspiezas()
    {
         DefaultCategoryDataset datasetbarra = new DefaultCategoryDataset();
         String titulografico="",totaltiendatexto="",totalentradatexto="",titulografico2="";
         int totalfilasreporte=this.jtbl_estadisticasarticulo.getRowCount()-1,i=0,ii=0;
         for(i=0;i<totalfilasreporte;i++)
         {
             totaltiendatexto = jtbl_estadisticasarticulo.getValueAt(i, 4).toString();
             totalentradatexto = jtbl_estadisticasarticulo.getValueAt(i, 2).toString();

             System.out.println(totaltiendatexto);
             titulografico="Venta";
             titulografico2="Compra";
             datasetbarra.addValue(Float.valueOf(totaltiendatexto.replace(",","").replace(".",""))*-1,titulografico,jtbl_estadisticasarticulo.getValueAt(i, 0).toString().replace("<html><p align=justify>","").replace("<br>","").replace("</p></html>", "venta"));
             datasetbarra.addValue(Float.valueOf(totalentradatexto.replace(",","").replace(".","")),titulografico2,jtbl_estadisticasarticulo.getValueAt(i, 0).toString().replace("<html><p align=justify>","").replace("<br>","").replace("</p></html>", "Compra"));

         }
        graficacion_varios_barras gvbtempo = new graficacion_varios_barras("Sistema Integral: Estadisticas Articulo",datasetbarra,"Piezas Compras Vs Ventas:"+this.jtf_descripcion.getText()+" "+this.jtf_clave.getText(),"Tiendas");
        gvbtempo.pack();
        RefineryUtilities.centerFrameOnScreen(gvbtempo);
        gvbtempo.setVisible(true);
     }

private void carga_datos_reportediferencias(int idtienda,int idfoliopadre,int opcion,String textbusqueda)
    {
       DecimalFormat miformat = new DecimalFormat("###,###,###,###");
       //invoco al metodo que trae el recordset de datos
       String htmlabre="<html><BODY>",htmlcierra="</BODY></html>",colorabre="",colorcierra="";
       float colexis=0;

        while(jtable_modelo_kardex.getRowCount()>0)jtable_modelo_kardex.removeRow(0);
       //voy por el detalle del documento
       Object[] fnewRow = new Object[11];
       String idcadena[]=null;
       rs = x.sieuno_executediversosv2("select * from x1sieuno_articulo_inven_congelar_reportdiferencias("+idtienda+","+idfoliopadre+","+opcion+",'"+textbusqueda+"') as (iddet integer,idfisico integer,clave character varying(16),cantteo numeric,cantfis numeric,observa text,costo numeric,precio numeric,impcostofis numeric,importpreciofis numeric,importcosteo numeric,importprecioteo numeric,cantdif numeric,costodif numeric,preciodif numeric,descripcion character varying(80),familia integer,subfam integer,fechaulti date,tementrada character varying(25),item character varying(80),precio1 numeric,nombrefamilia character varying(30),nombresubfamilia character varying(50),idproducto integer,fechainve date);",variables_global.getconexiongral());
        try
        {
            while (rs.next())
                {

                        idcadena=rs.getString("item").toString().split(":");
                        fnewRow[0]=idcadena[2]+":"+idcadena[0];
                        fnewRow[1]=rs.getString("nombrefamilia");
                        fnewRow[2]=rs.getString("nombresubfamilia");
                        fnewRow[3]=rs.getString("idfisico");
                        fnewRow[4]=rs.getString("clave");
                        fnewRow[5]=rs.getString("descripcion");
                        fnewRow[6]=idcadena[1];
                        fnewRow[7]=rs.getString("cantteo");
                        fnewRow[8]=rs.getString("cantfis");

                         colexis=rs.getFloat("cantdif");
                        colorabre="";
                        colorcierra="";
                        if (colexis<0)
                                {
                                    colorabre="<b><font color=#CC0000>";
                                    colorcierra="<font></b>";
                                }
                        if (colexis>0)
                                {
                                    colorabre="<b><font color=\"YELLOW\">";
                                    colorcierra="<font></b>";
                                }
                        fnewRow[9]=htmlabre+colorabre+rs.getFloat("cantdif")+colorcierra+htmlcierra;
                        if (rs.getString("fechainve") != null)
                            {
                                fnewRow[10]=this.fechaeuropea(rs.getString("fechainve"));
                            }
                        jtable_modelo_ifh.addRow(fnewRow);
                }
        }
        catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
      }


private void carga_datos_verarticuloseninve_histori(String idtienda,String idfoliopadre,int opcion,String textbusqueda)
    {
       DecimalFormat miformat = new DecimalFormat("###,###,###,###");
       String htmlabre="<html><BODY>",htmlcierra="</BODY></html>",colorabre="",colorcierra="";
       //invoco al metodo que trae el recordset de datos
       while(jtable_modelo_Artihistorifisico.getRowCount()>0)jtable_modelo_Artihistorifisico.removeRow(0);
       //voy por el detalle del documento
       Object[] fnewRow = new Object[9];
       String texto="select * from x1sieuno_articulo_inven_det_detalle("+idtienda+","+opcion+","+idfoliopadre+",'"+textbusqueda+"','') as (id integer,idpadre integer,clavearticulo character varying(16),cantfisica numeric,observacion text,costo numeric,precioventa numeric,importecosto numeric,importeprecio numeric,descripcion character varying(80),familia integer,subfam integer,tementrada character varying(25),item character varying(80),precio1actual numeric,nobrefamilia character varying(30),nombrefamilia character varying(50),idproducto integer,idinvefisico integer,fechaaplicacion date,horaaplica text,idelbora integer,idsupervisa integer,describeinve text,observaciones text,idstatusconge smallint,nombreelabora text,nombresupervisa text,describestatus character varying(40),idstatuspadre smallint);";
       System.out.println(texto);
       try
        {
            rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
            while (rs.next())
                {
                        fnewRow[0]=rs.getString("idpadre");
                        fnewRow[1]=rs.getString("describeinve");
                        fnewRow[2]=this.fechaeuropea(rs.getString("fechaaplicacion"))+" "+this.DiaSemana(rs.getString("fechaaplicacion")).substring(0,3);
                        fnewRow[3]=rs.getString("horaaplica");
                        fnewRow[4]=rs.getString("idelbora")+":"+rs.getString("nombreelabora");
                        fnewRow[5]=rs.getString("idsupervisa")+":"+rs.getString("nombresupervisa");
                        fnewRow[6]=rs.getString("clavearticulo");
                        fnewRow[7]=rs.getString("descripcion");
                        fnewRow[8]=rs.getString("cantfisica");
                        jtable_modelo_Artihistorifisico.addRow(fnewRow);
                }
        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }
      }


private void jtbl_articulosentiendasMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }
    private void jtb_catalogo_articulosMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }
private void jtbl_estadisticasarticuloMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel2 = new javax.swing.JPanel();
        jPanel10 = new javax.swing.JPanel();
        jLabel11 = new javax.swing.JLabel();
        jcbx_tementrada = new javax.swing.JComboBox();
        jLabel23 = new javax.swing.JLabel();
        jcbx_temporadasventa = new javax.swing.JComboBox();
        jLabel24 = new javax.swing.JLabel();
        jcbx_lineaarti = new javax.swing.JComboBox();
        jLabel25 = new javax.swing.JLabel();
        jtf_controlalmacen = new javax.swing.JTextField();
        jLabel26 = new javax.swing.JLabel();
        jtf_idstatus = new javax.swing.JTextField();
        jtf_describestatus = new javax.swing.JTextField();
        jLabel13 = new javax.swing.JLabel();
        jScrollPane2 = new javax.swing.JScrollPane();
        jta_observacion = new javax.swing.JTextArea();
        jLabel27 = new javax.swing.JLabel();
        jtf_unidadempaque = new javax.swing.JTextField();
        jLabel28 = new javax.swing.JLabel();
        jtf_idsublinea = new javax.swing.JTextField();
        jtf_sublineadescribe = new javax.swing.JTextField();
        jbtn_actualizarfamysub = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        jep_articuloimagen = new javax.swing.JEditorPane();
        jLabel8 = new javax.swing.JLabel();
        jtf_idsubfam = new javax.swing.JTextField();
        jtf_subfamilia = new javax.swing.JTextField();
        jtf_familia = new javax.swing.JTextField();
        jtf_idfam = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jtf_fechaultima = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        jtf_precio = new javax.swing.JTextField();
        jLabel22 = new javax.swing.JLabel();
        jtf_ultcosto = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        jtf_descripcion = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();
        jtf_item = new javax.swing.JTextField();
        jLabel10 = new javax.swing.JLabel();
        jtf_id = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        jtf_clave = new javax.swing.JTextField();
        jbtn_buscar = new javax.swing.JButton();
        jLabel21 = new javax.swing.JLabel();
        jtf_codigobarras = new javax.swing.JTextField();
        jPanel1 = new javax.swing.JPanel();
        jlbl_tienda = new javax.swing.JLabel();
        jPanel9 = new javax.swing.JPanel();
        jScrollPane13 = new javax.swing.JScrollPane();
        jtbl_kardex1 = new javax.swing.JTable(){
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                return false;
            }}
            ;
            jPanel14 = new javax.swing.JPanel();
            jScrollPane12 = new javax.swing.JScrollPane();
            jtbl_articulosentiendas = new javax.swing.JTable(){
                public boolean isCellEditable(int rowIndex, int mColIndex) {
                    return false;
                }}
                ;
                jlbl_nombretie = new javax.swing.JLabel();
                jlbl_tienda2 = new javax.swing.JLabel();
                jtf_idtiendadetalle = new javax.swing.JTextField();
                jtf_tiendausuario = new javax.swing.JTextField();
                jtf_tienda_clave = new javax.swing.JTextField();
                jLabel14 = new javax.swing.JLabel();
                jLabel35 = new javax.swing.JLabel();
                jtf_tienda_ite = new javax.swing.JTextField();
                jLabel2 = new javax.swing.JLabel();
                jtf_tienda_codigobarra = new javax.swing.JTextField();
                jtf_tienda_precioventa = new javax.swing.JTextField();
                jLabel16 = new javax.swing.JLabel();
                jtf_tienda_descrip = new javax.swing.JTextField();
                jLabel15 = new javax.swing.JLabel();
                jLabel34 = new javax.swing.JLabel();
                jtf_tienda_preciomayoreo = new javax.swing.JTextField();
                jLabel17 = new javax.swing.JLabel();
                jtf_tienda_preciorebaja = new javax.swing.JTextField();
                jtf_tiendastockmax = new javax.swing.JTextField();
                jLabel19 = new javax.swing.JLabel();
                jtf_tienda_stockmi = new javax.swing.JTextField();
                jLabel18 = new javax.swing.JLabel();
                jLabel20 = new javax.swing.JLabel();
                jtf_existencia = new javax.swing.JTextField();
                jbtn_guardar = new javax.swing.JButton();
                jbtn_creaentienda = new javax.swing.JButton();
                jPanel15 = new javax.swing.JPanel();
                jScrollPane14 = new javax.swing.JScrollPane();
                jtbl_kardex2 = new javax.swing.JTable(){
                    public boolean isCellEditable(int rowIndex, int mColIndex) {
                        return false;
                    }}
                    ;
                    jPanel3 = new javax.swing.JPanel();
                    jPanel5 = new javax.swing.JPanel();
                    jScrollPane4 = new javax.swing.JScrollPane();
                    jtbl_kardex = new javax.swing.JTable(){
                        public boolean isCellEditable(int rowIndex, int mColIndex) {
                            return false;
                        }}
                        ;
                        jPanel8 = new javax.swing.JPanel();
                        jScrollPane5 = new javax.swing.JScrollPane();
                        jtbl_estadisticasarticulo = new javax.swing.JTable(){
                            public boolean isCellEditable(int rowIndex, int mColIndex) {
                                return false;
                            }}
                            ;
                            jtf_costo = new javax.swing.JTextField();
                            jLabel4 = new javax.swing.JLabel();
                            jtf_clave_estadistica = new javax.swing.JTextField();
                            jtf_descripcion_estadistica = new javax.swing.JTextField();
                            jLabel29 = new javax.swing.JLabel();
                            jLabel30 = new javax.swing.JLabel();
                            jScrollPane3 = new javax.swing.JScrollPane();
                            jep_articuloimagenestadistica = new javax.swing.JEditorPane();
                            jCheckBox2 = new javax.swing.JCheckBox();
                            jtf_totalexistencia = new javax.swing.JTextField();
                            jLabel31 = new javax.swing.JLabel();
                            jtf_invecontitem = new javax.swing.JTextField();
                            jLabel32 = new javax.swing.JLabel();
                            jPanel7 = new javax.swing.JPanel();
                            jScrollPane6 = new javax.swing.JScrollPane();
                            jtbl_estadisticaventasxmes = new javax.swing.JTable(){
                                public boolean isCellEditable(int rowIndex, int mColIndex) {
                                    return false;
                                }}
                                ;
                                jCheckBox1 = new javax.swing.JCheckBox();
                                jPanel6 = new javax.swing.JPanel();
                                jScrollPane7 = new javax.swing.JScrollPane();
                                jtb_catalogo_articulos = new javax.swing.JTable()
                                {
                                    public boolean isCellEditable(int rowIndex, int mColIndex) {
                                        return false;
                                    }
                                }
                                ;
                                jScrollPane11 = new javax.swing.JScrollPane();
                                jtb_catalogo_historialfisico = new javax.swing.JTable()
                                {
                                    public boolean isCellEditable(int rowIndex, int mColIndex) {
                                        return false;
                                    }
                                }
                                ;
                                jPanel11 = new javax.swing.JPanel();
                                jPanel12 = new javax.swing.JPanel();
                                jScrollPane8 = new javax.swing.JScrollPane();
                                jtb_catalogo_distribucionalma = new javax.swing.JTable()
                                {
                                    public boolean isCellEditable(int rowIndex, int mColIndex) {
                                        return false;
                                    }
                                }
                                ;
                                jchk_graficadistribucion = new javax.swing.JCheckBox();
                                jPanel4 = new javax.swing.JPanel();
                                jPanel13 = new javax.swing.JPanel();
                                jScrollPane9 = new javax.swing.JScrollPane();
                                jtb_catalogo_derivadas = new javax.swing.JTable()
                                {
                                    public boolean isCellEditable(int rowIndex, int mColIndex) {
                                        if ((mColIndex == 2) || (mColIndex == 3))
                                        return true;
                                        else
                                        return false;
                                    }
                                }
                                ;
                                jbtn_crearclave = new javax.swing.JButton();
                                jbtn_guardarderivadas = new javax.swing.JButton();
                                jchbx_eliminarfila = new javax.swing.JCheckBox();
                                jcbx_verkardexidbase = new javax.swing.JCheckBox();
                                jScrollPane10 = new javax.swing.JScrollPane();
                                jtbl_kardexderivadadistribucion = new javax.swing.JTable(){
                                    public boolean isCellEditable(int rowIndex, int mColIndex) {
                                        return false;
                                    }}
                                    ;
                                    jLabel33 = new javax.swing.JLabel();
                                    jtf_idclavebase = new javax.swing.JTextField();
                                    jMenuBar1 = new javax.swing.JMenuBar();
                                    jMenu1 = new javax.swing.JMenu();
                                    jmni_guardar = new javax.swing.JMenuItem();
                                    jmni_actualizar = new javax.swing.JMenuItem();
                                    jmni_salir = new javax.swing.JMenuItem();
                                    jmni_crearclave = new javax.swing.JMenu();
                                    jMenuItem1 = new javax.swing.JMenuItem();
                                    jMenuItem2 = new javax.swing.JMenuItem();
                                    jMenuItem3 = new javax.swing.JMenuItem();
                                    jMenuItem4 = new javax.swing.JMenuItem();
                                    jMenuItem5 = new javax.swing.JMenuItem();
                                    jMenuItem6 = new javax.swing.JMenuItem();
                                    jMenuItem7 = new javax.swing.JMenuItem();
                                    jmni_escape = new javax.swing.JMenuItem();
                                    jMenuItem9 = new javax.swing.JMenuItem();
                                    jmni_buscar = new javax.swing.JMenuItem();
                                    jmni_activartienda = new javax.swing.JMenuItem();
                                    jmni_copiarbodega = new javax.swing.JMenuItem();
                                    jMenu3 = new javax.swing.JMenu();
                                    jMenuItem8 = new javax.swing.JMenuItem();
                                    jmni_crearsugerencia = new javax.swing.JMenuItem();

                                    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
                                    setName("Form"); // NOI18N

                                    jTabbedPane1.setName("jTabbedPane1"); // NOI18N
                                    jTabbedPane1.addChangeListener(new javax.swing.event.ChangeListener() {
                                        public void stateChanged(javax.swing.event.ChangeEvent evt) {
                                            jTabbedPane1StateChanged(evt);
                                        }
                                    });

                                    jPanel2.setName("jPanel2"); // NOI18N

                                    jPanel10.setName("jPanel10"); // NOI18N

                                    org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(sie_invdis.Sie_invdisApp.class).getContext().getResourceMap(articulos_sie_editar.class);
                                    jLabel11.setText(resourceMap.getString("jLabel11.text")); // NOI18N
                                    jLabel11.setName("jLabel11"); // NOI18N

                                    jcbx_tementrada.setName("jcbx_tementrada"); // NOI18N
                                    jcbx_tementrada.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jcbx_tementradaActionPerformed(evt);
                                        }
                                    });

                                    jLabel23.setText(resourceMap.getString("jLabel23.text")); // NOI18N
                                    jLabel23.setName("jLabel23"); // NOI18N

                                    jcbx_temporadasventa.setName("jcbx_temporadasventa"); // NOI18N
                                    jcbx_temporadasventa.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jcbx_temporadasventaActionPerformed(evt);
                                        }
                                    });

                                    jLabel24.setText(resourceMap.getString("jLabel24.text")); // NOI18N
                                    jLabel24.setName("jLabel24"); // NOI18N

                                    jcbx_lineaarti.setName("jcbx_lineaarti"); // NOI18N
                                    jcbx_lineaarti.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jcbx_lineaartiActionPerformed(evt);
                                        }
                                    });

                                    jLabel25.setText(resourceMap.getString("jLabel25.text")); // NOI18N
                                    jLabel25.setName("jLabel25"); // NOI18N

                                    jtf_controlalmacen.setEditable(false);
                                    jtf_controlalmacen.setName("jtf_controlalmacen"); // NOI18N

                                    jLabel26.setText(resourceMap.getString("jLabel26.text")); // NOI18N
                                    jLabel26.setName("jLabel26"); // NOI18N

                                    jtf_idstatus.setEditable(false);
                                    jtf_idstatus.setName("jtf_idstatus"); // NOI18N

                                    jtf_describestatus.setEditable(false);
                                    jtf_describestatus.setToolTipText(resourceMap.getString("jtf_describestatus.toolTipText")); // NOI18N
                                    jtf_describestatus.setName("jtf_describestatus"); // NOI18N

                                    jLabel13.setText(resourceMap.getString("jLabel13.text")); // NOI18N
                                    jLabel13.setName("jLabel13"); // NOI18N

                                    jScrollPane2.setName("jScrollPane2"); // NOI18N

                                    jta_observacion.setColumns(20);
                                    jta_observacion.setRows(5);
                                    jta_observacion.setName("jta_observacion"); // NOI18N
                                    jScrollPane2.setViewportView(jta_observacion);

                                    jLabel27.setText(resourceMap.getString("jLabel27.text")); // NOI18N
                                    jLabel27.setName("jLabel27"); // NOI18N

                                    jtf_unidadempaque.setEditable(false);
                                    jtf_unidadempaque.setName("jtf_unidadempaque"); // NOI18N

                                    jLabel28.setText(resourceMap.getString("jLabel28.text")); // NOI18N
                                    jLabel28.setName("jLabel28"); // NOI18N

                                    jtf_idsublinea.setEditable(false);
                                    jtf_idsublinea.setName("jtf_idsublinea"); // NOI18N

                                    jtf_sublineadescribe.setEditable(false);
                                    jtf_sublineadescribe.setToolTipText(resourceMap.getString("jtf_sublineadescribe.toolTipText")); // NOI18N
                                    jtf_sublineadescribe.setName("jtf_sublineadescribe"); // NOI18N

                                    jbtn_actualizarfamysub.setIcon(resourceMap.getIcon("jbtn_actualizarfamysub.icon")); // NOI18N
                                    jbtn_actualizarfamysub.setText(resourceMap.getString("jbtn_actualizarfamysub.text")); // NOI18N
                                    jbtn_actualizarfamysub.setToolTipText(resourceMap.getString("jbtn_actualizarfamysub.toolTipText")); // NOI18N
                                    jbtn_actualizarfamysub.setName("jbtn_actualizarfamysub"); // NOI18N
                                    jbtn_actualizarfamysub.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jbtn_actualizarfamysubActionPerformed(evt);
                                        }
                                    });

                                    jScrollPane1.setName("jScrollPane1"); // NOI18N

                                    jep_articuloimagen.setContentType(resourceMap.getString("jep_articuloimagen.contentType")); // NOI18N
                                    jep_articuloimagen.setName("jep_articuloimagen"); // NOI18N
                                    jScrollPane1.setViewportView(jep_articuloimagen);

                                    jLabel8.setText(resourceMap.getString("jLabel8.text")); // NOI18N
                                    jLabel8.setName("jLabel8"); // NOI18N

                                    jtf_idsubfam.setEditable(false);
                                    jtf_idsubfam.setToolTipText(resourceMap.getString("jtf_idsubfam.toolTipText")); // NOI18N
                                    jtf_idsubfam.setName("jtf_idsubfam"); // NOI18N
                                    jtf_idsubfam.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jtf_idsubfamActionPerformed(evt);
                                        }
                                    });

                                    jtf_subfamilia.setEditable(false);
                                    jtf_subfamilia.setToolTipText(resourceMap.getString("jtf_subfamilia.toolTipText")); // NOI18N
                                    jtf_subfamilia.setName("jtf_subfamilia"); // NOI18N
                                    jtf_subfamilia.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jtf_subfamiliaActionPerformed(evt);
                                        }
                                    });

                                    jtf_familia.setEditable(false);
                                    jtf_familia.setToolTipText(resourceMap.getString("jtf_familia.toolTipText")); // NOI18N
                                    jtf_familia.setName("jtf_familia"); // NOI18N
                                    jtf_familia.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jtf_familiaActionPerformed(evt);
                                        }
                                    });

                                    jtf_idfam.setToolTipText(resourceMap.getString("jtf_idfam.toolTipText")); // NOI18N
                                    jtf_idfam.setName("jtf_idfam"); // NOI18N
                                    jtf_idfam.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jtf_idfamActionPerformed(evt);
                                        }
                                    });

                                    jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N
                                    jLabel6.setName("jLabel6"); // NOI18N

                                    jLabel12.setText(resourceMap.getString("jLabel12.text")); // NOI18N
                                    jLabel12.setName("jLabel12"); // NOI18N

                                    jtf_fechaultima.setEditable(false);
                                    jtf_fechaultima.setName("jtf_fechaultima"); // NOI18N

                                    jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
                                    jLabel5.setName("jLabel5"); // NOI18N

                                    jtf_precio.setName("jtf_precio"); // NOI18N
                                    jtf_precio.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jtf_precioActionPerformed(evt);
                                        }
                                    });

                                    jLabel22.setText(resourceMap.getString("jLabel22.text")); // NOI18N
                                    jLabel22.setName("jLabel22"); // NOI18N

                                    jtf_ultcosto.setEditable(false);
                                    jtf_ultcosto.setToolTipText(resourceMap.getString("jtf_ultcosto.toolTipText")); // NOI18N
                                    jtf_ultcosto.setName("jtf_ultcosto"); // NOI18N
                                    jtf_ultcosto.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jtf_ultcostoActionPerformed(evt);
                                        }
                                    });

                                    jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
                                    jLabel3.setName("jLabel3"); // NOI18N

                                    jtf_descripcion.setName("jtf_descripcion"); // NOI18N
                                    jtf_descripcion.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jtf_descripcionActionPerformed(evt);
                                        }
                                    });

                                    jLabel7.setText(resourceMap.getString("jLabel7.text")); // NOI18N
                                    jLabel7.setName("jLabel7"); // NOI18N

                                    jtf_item.setEditable(false);
                                    jtf_item.setMinimumSize(new java.awt.Dimension(6, 18));
                                    jtf_item.setName("jtf_item"); // NOI18N
                                    jtf_item.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jtf_itemActionPerformed(evt);
                                        }
                                    });

                                    jLabel10.setText(resourceMap.getString("jLabel10.text")); // NOI18N
                                    jLabel10.setName("jLabel10"); // NOI18N

                                    jtf_id.setEditable(false);
                                    jtf_id.setFont(resourceMap.getFont("jtf_id.font")); // NOI18N
                                    jtf_id.setName("jtf_id"); // NOI18N

                                    jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
                                    jLabel1.setName("jLabel1"); // NOI18N

                                    jtf_clave.setEditable(false);
                                    jtf_clave.setFont(resourceMap.getFont("jtf_clave.font")); // NOI18N
                                    jtf_clave.setName("jtf_clave"); // NOI18N
                                    jtf_clave.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jtf_claveActionPerformed(evt);
                                        }
                                    });

                                    jbtn_buscar.setIcon(resourceMap.getIcon("jbtn_buscar.icon")); // NOI18N
                                    jbtn_buscar.setText(resourceMap.getString("jbtn_buscar.text")); // NOI18N
                                    jbtn_buscar.setName("jbtn_buscar"); // NOI18N
                                    jbtn_buscar.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jbtn_buscarActionPerformed(evt);
                                        }
                                    });

                                    jLabel21.setText(resourceMap.getString("jLabel21.text")); // NOI18N
                                    jLabel21.setName("jLabel21"); // NOI18N

                                    jtf_codigobarras.setEditable(false);
                                    jtf_codigobarras.setName("jtf_codigobarras"); // NOI18N
                                    jtf_codigobarras.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jtf_codigobarrasActionPerformed(evt);
                                        }
                                    });

                                    javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
                                    jPanel10.setLayout(jPanel10Layout);
                                    jPanel10Layout.setHorizontalGroup(
                                        jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel10Layout.createSequentialGroup()
                                            .addContainerGap()
                                            .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel10Layout.createSequentialGroup()
                                                    .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 314, Short.MAX_VALUE)
                                                    .addGap(47, 47, 47)
                                                    .addComponent(jbtn_actualizarfamysub)
                                                    .addGap(570, 570, 570))
                                                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel10Layout.createSequentialGroup()
                                                        .addGap(102, 102, 102)
                                                        .addComponent(jLabel1)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jtf_clave, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addGap(15, 15, 15)
                                                        .addComponent(jbtn_buscar)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jLabel21)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                        .addComponent(jtf_codigobarras, javax.swing.GroupLayout.PREFERRED_SIZE, 209, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addGap(103, 103, 103))
                                                    .addGroup(jPanel10Layout.createSequentialGroup()
                                                        .addComponent(jLabel10)
                                                        .addGap(18, 18, 18)
                                                        .addComponent(jtf_id, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                                .addGroup(jPanel10Layout.createSequentialGroup()
                                                    .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                    .addComponent(jtf_descripcion, javax.swing.GroupLayout.PREFERRED_SIZE, 340, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                    .addComponent(jLabel7)
                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                    .addComponent(jtf_item, javax.swing.GroupLayout.PREFERRED_SIZE, 137, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addContainerGap(401, Short.MAX_VALUE))
                                                .addGroup(jPanel10Layout.createSequentialGroup()
                                                    .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                        .addGroup(jPanel10Layout.createSequentialGroup()
                                                            .addComponent(jLabel13)
                                                            .addGap(263, 263, 263))
                                                        .addGroup(jPanel10Layout.createSequentialGroup()
                                                            .addComponent(jLabel5)
                                                            .addGap(45, 45, 45)
                                                            .addComponent(jtf_precio, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                            .addComponent(jLabel22)
                                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                            .addComponent(jtf_ultcosto, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                        .addGroup(jPanel10Layout.createSequentialGroup()
                                                            .addComponent(jLabel12)
                                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                            .addComponent(jtf_fechaultima, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                        .addGroup(jPanel10Layout.createSequentialGroup()
                                                            .addComponent(jLabel6)
                                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                            .addComponent(jtf_idfam, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                            .addComponent(jtf_familia, javax.swing.GroupLayout.DEFAULT_SIZE, 223, Short.MAX_VALUE))
                                                        .addGroup(jPanel10Layout.createSequentialGroup()
                                                            .addComponent(jLabel8)
                                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                            .addComponent(jtf_idsubfam, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                            .addComponent(jtf_subfamilia, javax.swing.GroupLayout.DEFAULT_SIZE, 207, Short.MAX_VALUE))
                                                        .addGroup(jPanel10Layout.createSequentialGroup()
                                                            .addComponent(jLabel11)
                                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                            .addComponent(jcbx_tementrada, 0, 247, Short.MAX_VALUE))
                                                        .addGroup(jPanel10Layout.createSequentialGroup()
                                                            .addComponent(jLabel23)
                                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                            .addComponent(jcbx_temporadasventa, 0, 260, Short.MAX_VALUE))
                                                        .addGroup(jPanel10Layout.createSequentialGroup()
                                                            .addComponent(jLabel24)
                                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                            .addComponent(jcbx_lineaarti, javax.swing.GroupLayout.PREFERRED_SIZE, 222, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                        .addGroup(jPanel10Layout.createSequentialGroup()
                                                            .addComponent(jLabel25)
                                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                            .addComponent(jtf_controlalmacen, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                        .addGroup(jPanel10Layout.createSequentialGroup()
                                                            .addComponent(jLabel26)
                                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                            .addComponent(jtf_idstatus, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                            .addComponent(jtf_describestatus, javax.swing.GroupLayout.PREFERRED_SIZE, 182, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                        .addGroup(jPanel10Layout.createSequentialGroup()
                                                            .addComponent(jLabel27)
                                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                            .addComponent(jtf_unidadempaque, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addGap(158, 158, 158))
                                                        .addGroup(jPanel10Layout.createSequentialGroup()
                                                            .addComponent(jLabel28)
                                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                            .addComponent(jtf_idsublinea, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                            .addComponent(jtf_sublineadescribe, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addGap(25, 25, 25)))
                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 428, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addGap(292, 292, 292))))
                                    );
                                    jPanel10Layout.setVerticalGroup(
                                        jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel10Layout.createSequentialGroup()
                                            .addContainerGap()
                                            .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                .addComponent(jLabel10)
                                                .addComponent(jtf_id, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(jLabel1)
                                                .addComponent(jtf_clave, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(jLabel21)
                                                .addComponent(jtf_codigobarras, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(jbtn_buscar))
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                .addComponent(jLabel3)
                                                .addComponent(jtf_descripcion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(jLabel7)
                                                .addComponent(jtf_item, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addGroup(jPanel10Layout.createSequentialGroup()
                                                    .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(jLabel5)
                                                        .addComponent(jtf_precio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(jLabel22)
                                                        .addComponent(jtf_ultcosto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                    .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(jLabel12)
                                                        .addComponent(jtf_fechaultima, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                    .addGap(18, 18, 18)
                                                    .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(jtf_idfam, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(jtf_familia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(jLabel6))
                                                    .addGap(18, 18, 18)
                                                    .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(jLabel8)
                                                        .addComponent(jtf_idsubfam, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(jtf_subfamilia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                    .addGap(18, 18, 18)
                                                    .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(jLabel11)
                                                        .addComponent(jcbx_tementrada, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                    .addGap(18, 18, 18)
                                                    .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(jLabel23)
                                                        .addComponent(jcbx_temporadasventa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                    .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(jLabel24)
                                                        .addComponent(jcbx_lineaarti, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                    .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(jLabel25)
                                                        .addComponent(jtf_controlalmacen, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                    .addGap(18, 18, 18)
                                                    .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(jLabel26)
                                                        .addComponent(jtf_idstatus, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(jtf_describestatus, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                    .addGap(14, 14, 14)
                                                    .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(jLabel27)
                                                        .addComponent(jtf_unidadempaque, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                    .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(jLabel28)
                                                        .addComponent(jtf_idsublinea, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(jtf_sublineadescribe, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                    .addComponent(jLabel13))
                                                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 301, javax.swing.GroupLayout.PREFERRED_SIZE))
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                .addComponent(jbtn_actualizarfamysub)
                                                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE))
                                            .addContainerGap(50, Short.MAX_VALUE))
                                    );

                                    javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
                                    jPanel2.setLayout(jPanel2Layout);
                                    jPanel2Layout.setHorizontalGroup(
                                        jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jPanel10, javax.swing.GroupLayout.DEFAULT_SIZE, 999, Short.MAX_VALUE)
                                    );
                                    jPanel2Layout.setVerticalGroup(
                                        jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel2Layout.createSequentialGroup()
                                            .addComponent(jPanel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addContainerGap())
                                    );

                                    jTabbedPane1.addTab("<html>Datos Genera<U><b>l</b></U>es</html>", jPanel2);

                                    jPanel1.setName("jPanel1"); // NOI18N

                                    jlbl_tienda.setName("jlbl_tienda"); // NOI18N

                                    jPanel9.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel9.border.title"))); // NOI18N
                                    jPanel9.setName("jPanel9"); // NOI18N

                                    jScrollPane13.setName("jScrollPane13"); // NOI18N

                                    jtbl_kardex1.setModel(this.jtable_modelo_kardex);
                                    jtbl_kardex1.setName("jtbl_kardex1"); // NOI18N
                                    jScrollPane13.setViewportView(jtbl_kardex1);

                                    javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
                                    jPanel9.setLayout(jPanel9Layout);
                                    jPanel9Layout.setHorizontalGroup(
                                        jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jScrollPane13, javax.swing.GroupLayout.PREFERRED_SIZE, 974, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    );
                                    jPanel9Layout.setVerticalGroup(
                                        jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jScrollPane13, javax.swing.GroupLayout.DEFAULT_SIZE, 122, Short.MAX_VALUE)
                                    );

                                    jPanel14.setName("jPanel14"); // NOI18N

                                    jScrollPane12.setName("jScrollPane12"); // NOI18N

                                    jtbl_articulosentiendas.setModel(this.jtable_modelo);
                                    jtbl_articulosentiendas.setName("jtbl_articulosentiendas"); // NOI18N
                                    jtbl_articulosentiendas.setRowHeight(22);
                                    jtbl_articulosentiendas.addMouseListener(new java.awt.event.MouseAdapter() {
                                        public void mouseClicked(java.awt.event.MouseEvent evt) {
                                            jtbl_articulosentiendasMouseClicked(evt);
                                            if(evt.getClickCount() >= 1)
                                            {
                                                dioclickpakardex2(evt);
                                                //System.out.println(" double click" );
                                            }
                                            if(evt.getClickCount() >= 1)
                                            {
                                                dioclickdetalletienda(evt);
                                                //System.out.println(" double click" );
                                            }
                                        }
                                    });
                                    jScrollPane12.setViewportView(jtbl_articulosentiendas);

                                    jlbl_nombretie.setText(resourceMap.getString("jlbl_nombretie.text")); // NOI18N
                                    jlbl_nombretie.setName("jlbl_nombretie"); // NOI18N

                                    jlbl_tienda2.setText(resourceMap.getString("jlbl_tienda2.text")); // NOI18N
                                    jlbl_tienda2.setName("jlbl_tienda2"); // NOI18N

                                    jtf_idtiendadetalle.setEditable(false);
                                    jtf_idtiendadetalle.setName("jtf_idtiendadetalle"); // NOI18N

                                    jtf_tiendausuario.setEditable(false);
                                    jtf_tiendausuario.setText(resourceMap.getString("jtf_tiendausuario.text")); // NOI18N
                                    jtf_tiendausuario.setName("jtf_tiendausuario"); // NOI18N

                                    jtf_tienda_clave.setEditable(false);
                                    jtf_tienda_clave.setName("jtf_tienda_clave"); // NOI18N

                                    jLabel14.setText(resourceMap.getString("jLabel14.text")); // NOI18N
                                    jLabel14.setName("jLabel14"); // NOI18N

                                    jLabel35.setText(resourceMap.getString("jLabel35.text")); // NOI18N
                                    jLabel35.setName("jLabel35"); // NOI18N

                                    jtf_tienda_ite.setEditable(false);
                                    jtf_tienda_ite.setName("jtf_tienda_ite"); // NOI18N

                                    jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
                                    jLabel2.setName("jLabel2"); // NOI18N

                                    jtf_tienda_codigobarra.setEditable(false);
                                    jtf_tienda_codigobarra.setToolTipText(resourceMap.getString("jtf_tienda_codigobarra.toolTipText")); // NOI18N
                                    jtf_tienda_codigobarra.setName("jtf_tienda_codigobarra"); // NOI18N
                                    jtf_tienda_codigobarra.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jtf_tienda_codigobarraActionPerformed(evt);
                                        }
                                    });

                                    jtf_tienda_precioventa.setEditable(false);
                                    jtf_tienda_precioventa.setName("jtf_tienda_precioventa"); // NOI18N
                                    jtf_tienda_precioventa.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jtf_tienda_precioventaActionPerformed(evt);
                                        }
                                    });

                                    jLabel16.setText(resourceMap.getString("jLabel16.text")); // NOI18N
                                    jLabel16.setName("jLabel16"); // NOI18N

                                    jtf_tienda_descrip.setEditable(false);
                                    jtf_tienda_descrip.setName("jtf_tienda_descrip"); // NOI18N
                                    jtf_tienda_descrip.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jtf_tienda_descripActionPerformed(evt);
                                        }
                                    });

                                    jLabel15.setText(resourceMap.getString("jLabel15.text")); // NOI18N
                                    jLabel15.setName("jLabel15"); // NOI18N

                                    jLabel34.setText(resourceMap.getString("jLabel34.text")); // NOI18N
                                    jLabel34.setName("jLabel34"); // NOI18N

                                    jtf_tienda_preciomayoreo.setEditable(false);
                                    jtf_tienda_preciomayoreo.setName("jtf_tienda_preciomayoreo"); // NOI18N
                                    jtf_tienda_preciomayoreo.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jtf_tienda_preciomayoreoActionPerformed(evt);
                                        }
                                    });

                                    jLabel17.setText(resourceMap.getString("jLabel17.text")); // NOI18N
                                    jLabel17.setName("jLabel17"); // NOI18N

                                    jtf_tienda_preciorebaja.setEditable(false);
                                    jtf_tienda_preciorebaja.setName("jtf_tienda_preciorebaja"); // NOI18N
                                    jtf_tienda_preciorebaja.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jtf_tienda_preciorebajaActionPerformed(evt);
                                        }
                                    });

                                    jtf_tiendastockmax.setEditable(false);
                                    jtf_tiendastockmax.setName("jtf_tiendastockmax"); // NOI18N
                                    jtf_tiendastockmax.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jtf_tiendastockmaxActionPerformed(evt);
                                        }
                                    });

                                    jLabel19.setText(resourceMap.getString("jLabel19.text")); // NOI18N
                                    jLabel19.setName("jLabel19"); // NOI18N

                                    jtf_tienda_stockmi.setEditable(false);
                                    jtf_tienda_stockmi.setName("jtf_tienda_stockmi"); // NOI18N
                                    jtf_tienda_stockmi.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jtf_tienda_stockmiActionPerformed(evt);
                                        }
                                    });

                                    jLabel18.setText(resourceMap.getString("jLabel18.text")); // NOI18N
                                    jLabel18.setName("jLabel18"); // NOI18N

                                    jLabel20.setText(resourceMap.getString("jLabel20.text")); // NOI18N
                                    jLabel20.setName("jLabel20"); // NOI18N

                                    jtf_existencia.setEditable(false);
                                    jtf_existencia.setFont(resourceMap.getFont("jtf_existencia.font")); // NOI18N
                                    jtf_existencia.setName("jtf_existencia"); // NOI18N

                                    jbtn_guardar.setText(resourceMap.getString("jbtn_guardar.text")); // NOI18N
                                    jbtn_guardar.setName("jbtn_guardar"); // NOI18N
                                    jbtn_guardar.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jbtn_guardarActionPerformed(evt);
                                        }
                                    });

                                    jbtn_creaentienda.setText(resourceMap.getString("jbtn_creaentienda.text")); // NOI18N
                                    jbtn_creaentienda.setToolTipText(resourceMap.getString("jbtn_creaentienda.toolTipText")); // NOI18N
                                    jbtn_creaentienda.setName("jbtn_creaentienda"); // NOI18N
                                    jbtn_creaentienda.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jbtn_creaentiendaActionPerformed(evt);
                                        }
                                    });

                                    javax.swing.GroupLayout jPanel14Layout = new javax.swing.GroupLayout(jPanel14);
                                    jPanel14.setLayout(jPanel14Layout);
                                    jPanel14Layout.setHorizontalGroup(
                                        jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel14Layout.createSequentialGroup()
                                            .addContainerGap()
                                            .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addComponent(jScrollPane12, javax.swing.GroupLayout.DEFAULT_SIZE, 974, Short.MAX_VALUE)
                                                .addGroup(jPanel14Layout.createSequentialGroup()
                                                    .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                        .addGroup(jPanel14Layout.createSequentialGroup()
                                                            .addComponent(jlbl_nombretie, javax.swing.GroupLayout.PREFERRED_SIZE, 136, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                            .addComponent(jlbl_tienda2)
                                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                            .addComponent(jtf_idtiendadetalle, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                            .addComponent(jtf_tiendausuario, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                            .addComponent(jLabel14)
                                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                            .addComponent(jtf_tienda_clave, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                            .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                            .addComponent(jtf_tienda_codigobarra, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                            .addComponent(jLabel15)
                                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                            .addComponent(jtf_tienda_descrip, javax.swing.GroupLayout.PREFERRED_SIZE, 243, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                            .addComponent(jLabel35))
                                                        .addGroup(jPanel14Layout.createSequentialGroup()
                                                            .addGap(10, 10, 10)
                                                            .addComponent(jLabel16)
                                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                            .addComponent(jtf_tienda_precioventa, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                            .addComponent(jLabel34)
                                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                            .addComponent(jtf_tienda_preciomayoreo, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                            .addComponent(jLabel17)
                                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                            .addComponent(jtf_tienda_preciorebaja, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                            .addComponent(jLabel18)
                                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                            .addComponent(jtf_tienda_stockmi, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                            .addComponent(jLabel19)
                                                            .addGap(11, 11, 11)
                                                            .addComponent(jtf_tiendastockmax, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                            .addComponent(jLabel20)
                                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                            .addComponent(jtf_existencia, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                            .addComponent(jbtn_guardar)))
                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                    .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                        .addComponent(jbtn_creaentienda, javax.swing.GroupLayout.DEFAULT_SIZE, 119, Short.MAX_VALUE)
                                                        .addComponent(jtf_tienda_ite, javax.swing.GroupLayout.DEFAULT_SIZE, 119, Short.MAX_VALUE))))
                                            .addContainerGap())
                                    );
                                    jPanel14Layout.setVerticalGroup(
                                        jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel14Layout.createSequentialGroup()
                                            .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addGroup(jPanel14Layout.createSequentialGroup()
                                                    .addContainerGap()
                                                    .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(jlbl_nombretie, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(jtf_idtiendadetalle, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(jlbl_tienda2)
                                                        .addComponent(jtf_tiendausuario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(jLabel14)
                                                        .addComponent(jtf_tienda_clave, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(jLabel2)
                                                        .addComponent(jtf_tienda_codigobarra, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(jLabel15)))
                                                .addGroup(jPanel14Layout.createSequentialGroup()
                                                    .addGap(21, 21, 21)
                                                    .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                        .addComponent(jLabel35)
                                                        .addComponent(jtf_tienda_descrip, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(jtf_tienda_ite, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                    .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(jbtn_guardar)
                                                        .addComponent(jbtn_creaentienda)
                                                        .addComponent(jtf_tienda_preciomayoreo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(jLabel34)
                                                        .addComponent(jLabel17)
                                                        .addComponent(jtf_tienda_preciorebaja, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(jLabel18)
                                                        .addComponent(jtf_tienda_stockmi, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(jLabel19)
                                                        .addComponent(jtf_tiendastockmax, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(jLabel20)
                                                        .addComponent(jtf_existencia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(jLabel16)
                                                        .addComponent(jtf_tienda_precioventa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jScrollPane12, javax.swing.GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE)
                                            .addContainerGap())
                                    );

                                    jPanel15.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel15.border.title"))); // NOI18N
                                    jPanel15.setName("jPanel15"); // NOI18N

                                    jScrollPane14.setName("jScrollPane14"); // NOI18N

                                    jtbl_kardex2.setModel(this.jtable_modelo_kardexb);
                                    jtbl_kardex2.setName("jtbl_kardex2"); // NOI18N
                                    jScrollPane14.setViewportView(jtbl_kardex2);

                                    javax.swing.GroupLayout jPanel15Layout = new javax.swing.GroupLayout(jPanel15);
                                    jPanel15.setLayout(jPanel15Layout);
                                    jPanel15Layout.setHorizontalGroup(
                                        jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel15Layout.createSequentialGroup()
                                            .addComponent(jScrollPane14, javax.swing.GroupLayout.PREFERRED_SIZE, 972, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addContainerGap(2, Short.MAX_VALUE))
                                    );
                                    jPanel15Layout.setVerticalGroup(
                                        jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jScrollPane14, javax.swing.GroupLayout.DEFAULT_SIZE, 126, Short.MAX_VALUE)
                                    );

                                    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
                                    jPanel1.setLayout(jPanel1Layout);
                                    jPanel1Layout.setHorizontalGroup(
                                        jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel1Layout.createSequentialGroup()
                                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addComponent(jPanel14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                                    .addComponent(jPanel15, javax.swing.GroupLayout.Alignment.LEADING, 0, 990, Short.MAX_VALUE)
                                                    .addComponent(jPanel9, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                                            .addGap(157, 157, 157)
                                            .addComponent(jlbl_tienda)
                                            .addContainerGap())
                                    );
                                    jPanel1Layout.setVerticalGroup(
                                        jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel1Layout.createSequentialGroup()
                                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addGroup(jPanel1Layout.createSequentialGroup()
                                                    .addContainerGap()
                                                    .addComponent(jlbl_tienda, javax.swing.GroupLayout.PREFERRED_SIZE, 0, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                .addComponent(jPanel14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jPanel15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                    );

                                    jTabbedPane1.addTab("<html> <U><b>D</b></U>etalle de Producto x Tienda</html>", jPanel1);

                                    jPanel3.setName("jPanel3"); // NOI18N

                                    jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel5.border.title"))); // NOI18N
                                    jPanel5.setName("jPanel5"); // NOI18N

                                    jScrollPane4.setName("jScrollPane4"); // NOI18N

                                    jtbl_kardex.setModel(this.jtable_modelo_kardex);
                                    jtbl_kardex.setName("jtbl_kardex"); // NOI18N
                                    jtbl_kardex.setRowHeight(22);
                                    jScrollPane4.setViewportView(jtbl_kardex);

                                    javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
                                    jPanel5.setLayout(jPanel5Layout);
                                    jPanel5Layout.setHorizontalGroup(
                                        jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 973, Short.MAX_VALUE)
                                    );
                                    jPanel5Layout.setVerticalGroup(
                                        jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jScrollPane4, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 222, Short.MAX_VALUE)
                                    );

                                    jPanel8.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel8.border.title"))); // NOI18N
                                    jPanel8.setName("jPanel8"); // NOI18N

                                    jScrollPane5.setName("jScrollPane5"); // NOI18N

                                    System.out.println("esta inicializando estadistica");
                                    jtbl_estadisticasarticulo.setModel(jtable_modelo_estadisticas);
                                    jtbl_estadisticasarticulo.setName("jtbl_estadisticasarticulo"); // NOI18N
                                    jtbl_estadisticasarticulo.setRowHeight(22);
                                    jtbl_estadisticasarticulo.addMouseListener(new java.awt.event.MouseAdapter() {
                                        public void mouseClicked(java.awt.event.MouseEvent evt) {
                                            jtbl_estadisticasarticuloMouseClicked(evt);
                                            if(evt.getClickCount() >= 1)
                                            {
                                                dioclickpakardex(evt);
                                                //System.out.println(" double click" );
                                            }
                                        }
                                    });
                                    jScrollPane5.setViewportView(jtbl_estadisticasarticulo);

                                    jtf_costo.setEditable(false);
                                    jtf_costo.setFont(resourceMap.getFont("jtf_costo.font")); // NOI18N
                                    jtf_costo.setName("jtf_costo"); // NOI18N
                                    jtf_costo.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jtf_costoActionPerformed(evt);
                                        }
                                    });

                                    jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
                                    jLabel4.setName("jLabel4"); // NOI18N

                                    jtf_clave_estadistica.setEditable(false);
                                    jtf_clave_estadistica.setFont(resourceMap.getFont("jtf_clave_estadistica.font")); // NOI18N
                                    jtf_clave_estadistica.setName("jtf_clave_estadistica"); // NOI18N
                                    jtf_clave_estadistica.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jtf_clave_estadisticaActionPerformed(evt);
                                        }
                                    });

                                    jtf_descripcion_estadistica.setEditable(false);
                                    jtf_descripcion_estadistica.setFont(resourceMap.getFont("jtf_descripcion_estadistica.font")); // NOI18N
                                    jtf_descripcion_estadistica.setName("jtf_descripcion_estadistica"); // NOI18N
                                    jtf_descripcion_estadistica.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jtf_descripcion_estadisticaActionPerformed(evt);
                                        }
                                    });

                                    jLabel29.setText(resourceMap.getString("jLabel29.text")); // NOI18N
                                    jLabel29.setName("jLabel29"); // NOI18N

                                    jLabel30.setText(resourceMap.getString("jLabel30.text")); // NOI18N
                                    jLabel30.setName("jLabel30"); // NOI18N

                                    jScrollPane3.setName("jScrollPane3"); // NOI18N

                                    jep_articuloimagenestadistica.setContentType(resourceMap.getString("jep_articuloimagenestadistica.contentType")); // NOI18N
                                    jep_articuloimagenestadistica.setEditable(false);
                                    jep_articuloimagenestadistica.setName("jep_articuloimagenestadistica"); // NOI18N
                                    jScrollPane3.setViewportView(jep_articuloimagenestadistica);

                                    jCheckBox2.setText(resourceMap.getString("jCheckBox2.text")); // NOI18N
                                    jCheckBox2.setToolTipText(resourceMap.getString("jCheckBox2.toolTipText")); // NOI18N
                                    jCheckBox2.setName("jCheckBox2"); // NOI18N
                                    jCheckBox2.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jCheckBox2ActionPerformed(evt);
                                        }
                                    });

                                    jtf_totalexistencia.setEditable(false);
                                    jtf_totalexistencia.setFont(resourceMap.getFont("jtf_totalexistencia.font")); // NOI18N
                                    jtf_totalexistencia.setName("jtf_totalexistencia"); // NOI18N

                                    jLabel31.setText(resourceMap.getString("jLabel31.text")); // NOI18N
                                    jLabel31.setName("jLabel31"); // NOI18N

                                    jtf_invecontitem.setEditable(false);
                                    jtf_invecontitem.setFont(resourceMap.getFont("jtf_invecontitem.font")); // NOI18N
                                    jtf_invecontitem.setName("jtf_invecontitem"); // NOI18N
                                    jtf_invecontitem.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jtf_invecontitemActionPerformed(evt);
                                        }
                                    });

                                    jLabel32.setText(resourceMap.getString("jLabel32.text")); // NOI18N
                                    jLabel32.setName("jLabel32"); // NOI18N

                                    javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
                                    jPanel8.setLayout(jPanel8Layout);
                                    jPanel8Layout.setHorizontalGroup(
                                        jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel8Layout.createSequentialGroup()
                                            .addComponent(jLabel30)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addComponent(jtf_clave_estadistica, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addComponent(jLabel29)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jtf_descripcion_estadistica, javax.swing.GroupLayout.PREFERRED_SIZE, 247, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addComponent(jLabel32, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jtf_invecontitem, javax.swing.GroupLayout.PREFERRED_SIZE, 159, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jtf_costo, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel8Layout.createSequentialGroup()
                                            .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 847, Short.MAX_VALUE)
                                            .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                .addGroup(jPanel8Layout.createSequentialGroup()
                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                    .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                            .addComponent(jLabel31)
                                                            .addComponent(jtf_totalexistencia, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                        .addComponent(jCheckBox2)))
                                                .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 126, Short.MAX_VALUE)))
                                    );
                                    jPanel8Layout.setVerticalGroup(
                                        jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel8Layout.createSequentialGroup()
                                            .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                .addComponent(jLabel30)
                                                .addComponent(jtf_clave_estadistica, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(jLabel29)
                                                .addComponent(jtf_descripcion_estadistica, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(jLabel32)
                                                .addComponent(jtf_invecontitem, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(jLabel4)
                                                .addComponent(jtf_costo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel8Layout.createSequentialGroup()
                                                    .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 128, Short.MAX_VALUE)
                                                    .addGap(18, 18, 18)
                                                    .addComponent(jCheckBox2)
                                                    .addGap(6, 6, 6)
                                                    .addComponent(jLabel31)
                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                    .addComponent(jtf_totalexistencia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 222, Short.MAX_VALUE))
                                            .addContainerGap())
                                    );

                                    javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
                                    jPanel3.setLayout(jPanel3Layout);
                                    jPanel3Layout.setHorizontalGroup(
                                        jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                                            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                .addComponent(jPanel5, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                .addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                            .addContainerGap())
                                    );
                                    jPanel3Layout.setVerticalGroup(
                                        jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                                            .addContainerGap()
                                            .addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addContainerGap())
                                    );

                                    jTabbedPane1.addTab("<html> <U><b>I</b></U>nventarios y Control</html>", jPanel3);

                                    jPanel7.setName("jPanel7"); // NOI18N

                                    jScrollPane6.setName("jScrollPane6"); // NOI18N

                                    System.out.println("esta inicializando estadistica x mes");
                                    jtbl_estadisticaventasxmes.setModel(this.jtable_modelo_ventamensual);
                                    jtbl_estadisticaventasxmes.setName("jtbl_estadisticaventasxmes"); // NOI18N
                                    jtbl_estadisticaventasxmes.setRowHeight(22);
                                    jScrollPane6.setViewportView(jtbl_estadisticaventasxmes);

                                    jCheckBox1.setText(resourceMap.getString("jCheckBox1.text")); // NOI18N
                                    jCheckBox1.setName("jCheckBox1"); // NOI18N
                                    jCheckBox1.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jCheckBox1ActionPerformed(evt);
                                        }
                                    });

                                    javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
                                    jPanel7.setLayout(jPanel7Layout);
                                    jPanel7Layout.setHorizontalGroup(
                                        jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel7Layout.createSequentialGroup()
                                            .addContainerGap()
                                            .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 576, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(jCheckBox1))
                                            .addContainerGap(413, Short.MAX_VALUE))
                                    );
                                    jPanel7Layout.setVerticalGroup(
                                        jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel7Layout.createSequentialGroup()
                                            .addGap(26, 26, 26)
                                            .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 359, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(26, 26, 26)
                                            .addComponent(jCheckBox1)
                                            .addContainerGap(137, Short.MAX_VALUE))
                                    );

                                    jTabbedPane1.addTab("Estadisticas Venta x Mes", jPanel7);

                                    jPanel6.setName("jPanel6"); // NOI18N

                                    jScrollPane7.setName("jScrollPane7"); // NOI18N

                                    System.out.println("esta inicializando inve fisico");
                                    jtb_catalogo_articulos.setModel(this.jtable_modelo_ifh);
                                    jtb_catalogo_articulos.setName("jtb_catalogo_articulos"); // NOI18N
                                    jtb_catalogo_articulos.setRowHeight(22);
                                    jtb_catalogo_articulos.addMouseListener(new java.awt.event.MouseAdapter() {
                                        public void mouseClicked(java.awt.event.MouseEvent evt) {
                                            jtb_catalogo_articulosMouseClicked(evt);
                                            if(evt.getClickCount() >= 1)
                                            {
                                                dioclickidarti(evt);
                                                //System.out.println(" double click" );

                                            }
                                        }
                                    });
                                    jScrollPane7.setViewportView(jtb_catalogo_articulos);

                                    jScrollPane11.setName("jScrollPane11"); // NOI18N

                                    jtb_catalogo_historialfisico.setModel(this.jtable_modelo_Artihistorifisico);
                                    jtb_catalogo_historialfisico.setName("jtb_catalogo_historialfisico"); // NOI18N
                                    jScrollPane11.setViewportView(jtb_catalogo_historialfisico);

                                    javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
                                    jPanel6.setLayout(jPanel6Layout);
                                    jPanel6Layout.setHorizontalGroup(
                                        jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel6Layout.createSequentialGroup()
                                            .addContainerGap()
                                            .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                                .addComponent(jScrollPane11, javax.swing.GroupLayout.Alignment.LEADING)
                                                .addComponent(jScrollPane7, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 920, Short.MAX_VALUE))
                                            .addContainerGap(69, Short.MAX_VALUE))
                                    );
                                    jPanel6Layout.setVerticalGroup(
                                        jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel6Layout.createSequentialGroup()
                                            .addGap(36, 36, 36)
                                            .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 335, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(18, 18, 18)
                                            .addComponent(jScrollPane11, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addContainerGap(73, Short.MAX_VALUE))
                                    );

                                    jTabbedPane1.addTab("Inventarios Fisicos", jPanel6);

                                    jPanel11.setName("jPanel11"); // NOI18N

                                    jPanel12.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel12.border.title"))); // NOI18N
                                    jPanel12.setName("jPanel12"); // NOI18N

                                    jScrollPane8.setName("jScrollPane8"); // NOI18N

                                    System.out.println("esta inicializando distribucionalma");
                                    jtb_catalogo_distribucionalma.setModel(this.jtable_modelo_distribucionalma);
                                    jtb_catalogo_distribucionalma.setName("jtb_catalogo_distribucionalma"); // NOI18N
                                    jtb_catalogo_distribucionalma.setRowHeight(22);
                                    jScrollPane8.setViewportView(jtb_catalogo_distribucionalma);

                                    jchk_graficadistribucion.setText(resourceMap.getString("jchk_graficadistribucion.text")); // NOI18N
                                    jchk_graficadistribucion.setName("jchk_graficadistribucion"); // NOI18N
                                    jchk_graficadistribucion.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jchk_graficadistribucionActionPerformed(evt);
                                        }
                                    });

                                    javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12);
                                    jPanel12.setLayout(jPanel12Layout);
                                    jPanel12Layout.setHorizontalGroup(
                                        jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jchk_graficadistribucion)
                                        .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 914, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    );
                                    jPanel12Layout.setVerticalGroup(
                                        jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel12Layout.createSequentialGroup()
                                            .addComponent(jScrollPane8, javax.swing.GroupLayout.DEFAULT_SIZE, 493, Short.MAX_VALUE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addComponent(jchk_graficadistribucion)
                                            .addContainerGap())
                                    );

                                    javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
                                    jPanel11.setLayout(jPanel11Layout);
                                    jPanel11Layout.setHorizontalGroup(
                                        jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel11Layout.createSequentialGroup()
                                            .addComponent(jPanel12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addContainerGap(69, Short.MAX_VALUE))
                                    );
                                    jPanel11Layout.setVerticalGroup(
                                        jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel11Layout.createSequentialGroup()
                                            .addContainerGap()
                                            .addComponent(jPanel12, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                    );

                                    jTabbedPane1.addTab("Distribucion", jPanel11);

                                    jPanel4.setName("jPanel4"); // NOI18N

                                    jPanel13.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel13.border.title"))); // NOI18N
                                    jPanel13.setName("jPanel13"); // NOI18N

                                    jScrollPane9.setName("jScrollPane9"); // NOI18N

                                    System.out.println("esta inicializando claves derivadas");
                                    jtb_catalogo_derivadas.setModel(this.jtable_modelo_clavesderivadas);
                                    jtb_catalogo_derivadas.setName("jtb_catalogo_derivadas"); // NOI18N
                                    jtb_catalogo_derivadas.setRowHeight(22);
                                    jScrollPane9.setViewportView(jtb_catalogo_derivadas);

                                    jbtn_crearclave.setText(resourceMap.getString("jbtn_crearclave.text")); // NOI18N
                                    jbtn_crearclave.setName("jbtn_crearclave"); // NOI18N
                                    jbtn_crearclave.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jbtn_crearclaveActionPerformed(evt);
                                        }
                                    });

                                    jbtn_guardarderivadas.setFont(resourceMap.getFont("jbtn_guardarderivadas.font")); // NOI18N
                                    jbtn_guardarderivadas.setText(resourceMap.getString("jbtn_guardarderivadas.text")); // NOI18N
                                    jbtn_guardarderivadas.setName("jbtn_guardarderivadas"); // NOI18N
                                    jbtn_guardarderivadas.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jbtn_guardarderivadasActionPerformed(evt);
                                        }
                                    });

                                    jchbx_eliminarfila.setText(resourceMap.getString("jchbx_eliminarfila.text")); // NOI18N
                                    jchbx_eliminarfila.setName("jchbx_eliminarfila"); // NOI18N
                                    jchbx_eliminarfila.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jchbx_eliminarfilaActionPerformed(evt);
                                        }
                                    });

                                    jcbx_verkardexidbase.setText(resourceMap.getString("jcbx_verkardexidbase.text")); // NOI18N
                                    jcbx_verkardexidbase.setName("jcbx_verkardexidbase"); // NOI18N
                                    jcbx_verkardexidbase.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jcbx_verkardexidbaseActionPerformed(evt);
                                        }
                                    });

                                    jScrollPane10.setName("jScrollPane10"); // NOI18N

                                    jtbl_kardexderivadadistribucion.setModel(this.jtable_modelo_kardex_deridestribucion);
                                    jtbl_kardexderivadadistribucion.setName("jtbl_kardexderivadadistribucion"); // NOI18N
                                    jtbl_kardexderivadadistribucion.setRowHeight(22);
                                    jScrollPane10.setViewportView(jtbl_kardexderivadadistribucion);

                                    javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13);
                                    jPanel13.setLayout(jPanel13Layout);
                                    jPanel13Layout.setHorizontalGroup(
                                        jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jScrollPane9, javax.swing.GroupLayout.DEFAULT_SIZE, 953, Short.MAX_VALUE)
                                        .addGroup(jPanel13Layout.createSequentialGroup()
                                            .addComponent(jbtn_crearclave)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addComponent(jbtn_guardarderivadas)
                                            .addGap(18, 18, 18)
                                            .addComponent(jchbx_eliminarfila)
                                            .addGap(222, 222, 222)
                                            .addComponent(jcbx_verkardexidbase, javax.swing.GroupLayout.PREFERRED_SIZE, 157, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addContainerGap())
                                        .addComponent(jScrollPane10, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 953, Short.MAX_VALUE)
                                    );
                                    jPanel13Layout.setVerticalGroup(
                                        jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel13Layout.createSequentialGroup()
                                            .addComponent(jScrollPane9, javax.swing.GroupLayout.PREFERRED_SIZE, 178, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(jbtn_crearclave)
                                                    .addComponent(jbtn_guardarderivadas))
                                                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(jchbx_eliminarfila)
                                                    .addComponent(jcbx_verkardexidbase)))
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addComponent(jScrollPane10, javax.swing.GroupLayout.DEFAULT_SIZE, 257, Short.MAX_VALUE)
                                            .addContainerGap())
                                    );

                                    jLabel33.setText(resourceMap.getString("jLabel33.text")); // NOI18N
                                    jLabel33.setName("jLabel33"); // NOI18N

                                    jtf_idclavebase.setEditable(false);
                                    jtf_idclavebase.setName("jtf_idclavebase"); // NOI18N

                                    javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
                                    jPanel4.setLayout(jPanel4Layout);
                                    jPanel4Layout.setHorizontalGroup(
                                        jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel4Layout.createSequentialGroup()
                                            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addGroup(jPanel4Layout.createSequentialGroup()
                                                    .addGap(15, 15, 15)
                                                    .addComponent(jLabel33)
                                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                    .addComponent(jtf_idclavebase, javax.swing.GroupLayout.PREFERRED_SIZE, 149, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                .addComponent(jPanel13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                            .addContainerGap(30, Short.MAX_VALUE))
                                    );
                                    jPanel4Layout.setVerticalGroup(
                                        jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel4Layout.createSequentialGroup()
                                            .addContainerGap()
                                            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                .addComponent(jtf_idclavebase, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(jLabel33))
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addComponent(jPanel13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addContainerGap())
                                    );

                                    jTabbedPane1.addTab("Claves Derivadas", jPanel4);

                                    jMenuBar1.setName("jMenuBar1"); // NOI18N

                                    jMenu1.setText(resourceMap.getString("jMenu1.text")); // NOI18N
                                    jMenu1.setName("jMenu1"); // NOI18N

                                    jmni_guardar.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_G, java.awt.event.InputEvent.ALT_MASK));
                                    jmni_guardar.setText(resourceMap.getString("jmni_guardar.text")); // NOI18N
                                    jmni_guardar.setName("jmni_guardar"); // NOI18N
                                    jmni_guardar.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jmni_guardarActionPerformed(evt);
                                        }
                                    });
                                    jMenu1.add(jmni_guardar);

                                    jmni_actualizar.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_R, java.awt.event.InputEvent.ALT_MASK));
                                    jmni_actualizar.setText(resourceMap.getString("jmni_actualizar.text")); // NOI18N
                                    jmni_actualizar.setName("jmni_actualizar"); // NOI18N
                                    jmni_actualizar.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jmni_actualizarActionPerformed(evt);
                                        }
                                    });
                                    jMenu1.add(jmni_actualizar);

                                    jmni_salir.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.ALT_MASK));
                                    jmni_salir.setText(resourceMap.getString("jmni_salir.text")); // NOI18N
                                    jmni_salir.setName("jmni_salir"); // NOI18N
                                    jmni_salir.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jmni_salirActionPerformed(evt);
                                        }
                                    });
                                    jMenu1.add(jmni_salir);

                                    jMenuBar1.add(jMenu1);

                                    jmni_crearclave.setText(resourceMap.getString("jmni_crearclave.text")); // NOI18N
                                    jmni_crearclave.setName("jmni_crearclave"); // NOI18N
                                    jmni_crearclave.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jmni_crearclaveActionPerformed(evt);
                                        }
                                    });

                                    jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_PAGE_DOWN, java.awt.event.InputEvent.CTRL_MASK));
                                    jMenuItem1.setText(resourceMap.getString("jMenuItem1.text")); // NOI18N
                                    jMenuItem1.setName("jMenuItem1"); // NOI18N
                                    jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jMenuItem1ActionPerformed(evt);
                                        }
                                    });
                                    jmni_crearclave.add(jMenuItem1);

                                    jMenuItem2.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_PAGE_UP, java.awt.event.InputEvent.CTRL_MASK));
                                    jMenuItem2.setText(resourceMap.getString("jMenuItem2.text")); // NOI18N
                                    jMenuItem2.setName("jMenuItem2"); // NOI18N
                                    jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jMenuItem2ActionPerformed(evt);
                                        }
                                    });
                                    jmni_crearclave.add(jMenuItem2);

                                    jMenuItem3.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.ALT_MASK));
                                    jMenuItem3.setText(resourceMap.getString("jMenuItem3.text")); // NOI18N
                                    jMenuItem3.setName("jMenuItem3"); // NOI18N
                                    jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jMenuItem3ActionPerformed(evt);
                                        }
                                    });
                                    jmni_crearclave.add(jMenuItem3);

                                    jMenuItem4.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_T, java.awt.event.InputEvent.ALT_MASK));
                                    jMenuItem4.setText(resourceMap.getString("jMenuItem4.text")); // NOI18N
                                    jMenuItem4.setName("jMenuItem4"); // NOI18N
                                    jMenuItem4.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jMenuItem4ActionPerformed(evt);
                                        }
                                    });
                                    jmni_crearclave.add(jMenuItem4);

                                    jMenuItem5.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_I, java.awt.event.InputEvent.ALT_MASK));
                                    jMenuItem5.setText(resourceMap.getString("jMenuItem5.text")); // NOI18N
                                    jMenuItem5.setName("jMenuItem5"); // NOI18N
                                    jMenuItem5.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jMenuItem5ActionPerformed(evt);
                                        }
                                    });
                                    jmni_crearclave.add(jMenuItem5);

                                    jMenuItem6.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_D, java.awt.event.InputEvent.ALT_MASK));
                                    jMenuItem6.setText(resourceMap.getString("jMenuItem6.text")); // NOI18N
                                    jMenuItem6.setName("jMenuItem6"); // NOI18N
                                    jMenuItem6.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jMenuItem6ActionPerformed(evt);
                                        }
                                    });
                                    jmni_crearclave.add(jMenuItem6);

                                    jMenuItem7.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_L, java.awt.event.InputEvent.ALT_MASK));
                                    jMenuItem7.setText(resourceMap.getString("jMenuItem7.text")); // NOI18N
                                    jMenuItem7.setName("jMenuItem7"); // NOI18N
                                    jMenuItem7.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jMenuItem7ActionPerformed(evt);
                                        }
                                    });
                                    jmni_crearclave.add(jMenuItem7);

                                    jmni_escape.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ESCAPE, 0));
                                    jmni_escape.setText(resourceMap.getString("jmni_escape.text")); // NOI18N
                                    jmni_escape.setName("jmni_escape"); // NOI18N
                                    jmni_escape.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jmni_escapeActionPerformed(evt);
                                        }
                                    });
                                    jmni_crearclave.add(jmni_escape);

                                    jMenuItem9.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F6, 0));
                                    jMenuItem9.setText(resourceMap.getString("jMenuItem9.text")); // NOI18N
                                    jMenuItem9.setName("jMenuItem9"); // NOI18N
                                    System.out.println("esta en los menus");
                                    jMenuItem9.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jMenuItem9ActionPerformed(evt);
                                        }
                                    });
                                    jmni_crearclave.add(jMenuItem9);

                                    jmni_buscar.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_B, java.awt.event.InputEvent.CTRL_MASK));
                                    jmni_buscar.setText(resourceMap.getString("jmni_buscar.text")); // NOI18N
                                    jmni_buscar.setName("jmni_buscar"); // NOI18N
                                    jmni_buscar.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jmni_buscarActionPerformed(evt);
                                        }
                                    });
                                    jmni_crearclave.add(jmni_buscar);

                                    jmni_activartienda.setText(resourceMap.getString("jmni_activartienda.text")); // NOI18N
                                    jmni_activartienda.setName("jmni_activartienda"); // NOI18N
                                    jmni_activartienda.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jmni_activartiendaActionPerformed(evt);
                                        }
                                    });
                                    jmni_crearclave.add(jmni_activartienda);

                                    jmni_copiarbodega.setText(resourceMap.getString("jmni_copiarbodega.text")); // NOI18N
                                    jmni_copiarbodega.setName("jmni_copiarbodega"); // NOI18N
                                    jmni_copiarbodega.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jmni_copiarbodegaActionPerformed(evt);
                                        }
                                    });
                                    jmni_crearclave.add(jmni_copiarbodega);

                                    jMenuBar1.add(jmni_crearclave);

                                    jMenu3.setText(resourceMap.getString("jMenu3.text")); // NOI18N
                                    jMenu3.setName("jMenu3"); // NOI18N

                                    jMenuItem8.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.ALT_MASK));
                                    jMenuItem8.setText(resourceMap.getString("jMenuItem8.text")); // NOI18N
                                    jMenuItem8.setName("jMenuItem8"); // NOI18N
                                    jMenuItem8.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jMenuItem8ActionPerformed(evt);
                                        }
                                    });
                                    jMenu3.add(jMenuItem8);

                                    jmni_crearsugerencia.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_U, java.awt.event.InputEvent.ALT_MASK));
                                    jmni_crearsugerencia.setText(resourceMap.getString("jmni_crearsugerencia.text")); // NOI18N
                                    jmni_crearsugerencia.setName("jmni_crearsugerencia"); // NOI18N
                                    jmni_crearsugerencia.addActionListener(new java.awt.event.ActionListener() {
                                        public void actionPerformed(java.awt.event.ActionEvent evt) {
                                            jmni_crearsugerenciaActionPerformed(evt);
                                        }
                                    });
                                    jMenu3.add(jmni_crearsugerencia);

                                    jMenuBar1.add(jMenu3);

                                    setJMenuBar(jMenuBar1);

                                    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
                                    getContentPane().setLayout(layout);
                                    layout.setHorizontalGroup(
                                        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 1004, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    );
                                    layout.setVerticalGroup(
                                        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(layout.createSequentialGroup()
                                            .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 599, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    );

                                    pack();
                                }// </editor-fold>//GEN-END:initComponents

    private void jmni_guardarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_guardarActionPerformed
        // TODO add your handling code here:
        this.jbtn_guardarActionPerformed(evt);
}//GEN-LAST:event_jmni_guardarActionPerformed

    private void jmni_actualizarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_actualizarActionPerformed
        // TODO add your handling code here:
        this.jbtn_actualizarfamysubActionPerformed(evt);
}//GEN-LAST:event_jmni_actualizarActionPerformed

    private void jmni_salirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_salirActionPerformed
        // TODO add your handling code here:
        if(JOptionPane.showConfirmDialog(null, "Realmente Desea Salir?")==0) {
            this.dispose();
        }
}//GEN-LAST:event_jmni_salirActionPerformed

    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
        // TODO add your handling code here:
        if (indexjtapestana==2) {
            indexjtapestana=0;
        } else {
            indexjtapestana+=1;
        }

        if ((indexjtapestana==1)&&(yacarguearticulostienda==0)) {
            yacarguearticulostienda=1;
             this.carga_datos_articulotodaslastiendas();
             this.carga_datos_articulotodaslasbodegas();

        }
        this.jTabbedPane1.setSelectedIndex(indexjtapestana);
}//GEN-LAST:event_jMenuItem1ActionPerformed

    private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
        // TODO add your handling code here:
        if (indexjtapestana==0) {
            indexjtapestana=2;
        } else {
            indexjtapestana-=1;
        }
        if ((indexjtapestana==1)&&(yacarguearticulostienda==0)) {
            yacarguearticulostienda=1;
             this.carga_datos_articulotodaslastiendas();
              this.carga_datos_articulotodaslasbodegas();

        }
        this.jTabbedPane1.setSelectedIndex(indexjtapestana);
}//GEN-LAST:event_jMenuItem2ActionPerformed

    private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed
        // TODO add your handling code here:
        this.jtf_tienda_codigobarra.requestFocus();
}//GEN-LAST:event_jMenuItem3ActionPerformed

    private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem4ActionPerformed
        // TODO add your handling code here:
        //this.jrbtn_all.requestFocus();
}//GEN-LAST:event_jMenuItem4ActionPerformed

    private void jMenuItem5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem5ActionPerformed
        // TODO add your handling code here:
        this.jTabbedPane1.setSelectedIndex(2);
}//GEN-LAST:event_jMenuItem5ActionPerformed

    private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem6ActionPerformed
        // TODO add your handling code here:
        this.jTabbedPane1.setSelectedIndex(1);
}//GEN-LAST:event_jMenuItem6ActionPerformed

    private void jMenuItem7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem7ActionPerformed
        // TODO add your handling code here:
        this.jTabbedPane1.setSelectedIndex(0);
}//GEN-LAST:event_jMenuItem7ActionPerformed

    private void jmni_escapeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_escapeActionPerformed
        // TODO add your handling code here:
        this.jmni_salirActionPerformed(evt);
}//GEN-LAST:event_jmni_escapeActionPerformed

    private void jMenuItem9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem9ActionPerformed
        // TODO add your handling code here:
        this.jbtn_crearclaveActionPerformed(evt);
}//GEN-LAST:event_jMenuItem9ActionPerformed

    private void jMenuItem8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem8ActionPerformed
        // TODO add your handling code here:
        this.ayuda();
}//GEN-LAST:event_jMenuItem8ActionPerformed

    private void jmni_crearsugerenciaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_crearsugerenciaActionPerformed
        // TODO add your handling code here:
        this.crearcomentario();
}//GEN-LAST:event_jmni_crearsugerenciaActionPerformed

    private void jtf_precioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_precioActionPerformed
        // TODO add your handling code here:
        this.jtf_ultcosto.requestFocus();
        if(variables_global.getnivelusu()<3)
            {
                this.articulo_actualizacodigo(7, this.jtf_id.getText(), this.jtf_idfam.getText(), this.jtf_idsubfam.getText(), this.jtf_precio.getText(), this.jtf_clave.getText());
            }
    }//GEN-LAST:event_jtf_precioActionPerformed

    private void jtf_descripcionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_descripcionActionPerformed
        // TODO add your handling code here:
        this.articulo_actualizacodigo(8, this.jtf_id.getText(), this.jtf_idfam.getText(), this.jtf_idsubfam.getText(), this.jtf_descripcion.getText().toUpperCase().trim(), this.jtf_clave.getText());
        this.jtf_item.requestFocus();
}//GEN-LAST:event_jtf_descripcionActionPerformed

    private void jtf_itemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_itemActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jtf_itemActionPerformed

    private void jtf_claveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_claveActionPerformed
        // TODO add your handling code here:
        this.jtf_tienda_codigobarra.requestFocus();
}//GEN-LAST:event_jtf_claveActionPerformed

    private void jtf_subfamiliaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_subfamiliaActionPerformed
        // TODO add your handling code here:
        this.jbtn_guardar.requestFocus();
}//GEN-LAST:event_jtf_subfamiliaActionPerformed

    private void jtf_familiaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_familiaActionPerformed
        // TODO add your handling code here:
        this.jtf_subfamilia.requestFocus();
}//GEN-LAST:event_jtf_familiaActionPerformed

    private void jtf_idfamActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_idfamActionPerformed
        // TODO add your hjtf_idsubfamandling code here:
        //this.jtf_idsubfam.requestFocus();
        this.articulo_actualizacodigo(9, this.jtf_id.getText(), this.jtf_idfam.getText(), this.jtf_idsubfam.getText(), this.jtf_codigobarras.getText(), this.jtf_clave.getText());
}//GEN-LAST:event_jtf_idfamActionPerformed

    private void jtf_idsubfamActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_idsubfamActionPerformed
        // TODO add your handling code here:
        this.jbtn_actualizarfamysub.requestFocus();
}//GEN-LAST:event_jtf_idsubfamActionPerformed

    private void jtf_codigobarrasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_codigobarrasActionPerformed
        // TODO add your handling codarticulo_actualizacodigoe here:
        this.articulo_actualizacodigo(2, this.jtf_id.getText(), this.jtf_idfam.getText(), this.jtf_idsubfam.getText(), this.jtf_codigobarras.getText(), this.jtf_clave.getText());
}//GEN-LAST:event_jtf_codigobarrasActionPerformed

    private void jtf_ultcostoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_ultcostoActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jtf_ultcostoActionPerformed

    private void jbtn_actualizarfamysubActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_actualizarfamysubActionPerformed
        // TODO add your handling code here:
        if(JOptionPane.showConfirmDialog(null, "Desea Actualizar los Datos?")==0) {
            this.articulo_actualiza();
        }
}//GEN-LAST:event_jbtn_actualizarfamysubActionPerformed

    private void jcbx_temporadasventaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcbx_temporadasventaActionPerformed
        // TODO add your handling code here:
        if (controlcombotv > 0 ) {
            String arreglo_idtemv[]=this.jcbx_temporadasventa.getSelectedItem().toString().split(":");
            this.articulo_actualizacodigo(3, this.jtf_id.getText(),"0","0",arreglo_idtemv[0],"");
        }
}//GEN-LAST:event_jcbx_temporadasventaActionPerformed

    private void jcbx_lineaartiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcbx_lineaartiActionPerformed
        // TODO add your handling code here:
        if (controlcombola > 0 ) {
            String arreglo_idln[]=this.jcbx_lineaarti.getSelectedItem().toString().split(":");
            this.articulo_actualizacodigo(5, this.jtf_id.getText(),"0","0",arreglo_idln[0],"");
        }
}//GEN-LAST:event_jcbx_lineaartiActionPerformed

    private void jcbx_tementradaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcbx_tementradaActionPerformed
        // TODO add your handling code here:
        if (controlcombote > 0 ) {
            String arreglo_idteme[]=this.jcbx_tementrada.getSelectedItem().toString().split(":");
            this.articulo_actualizacodigo(6, this.jtf_id.getText(),"0","0",arreglo_idteme[0],"");
        }
}//GEN-LAST:event_jcbx_tementradaActionPerformed

    private void jtf_tienda_codigobarraActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_tienda_codigobarraActionPerformed
        // TODO add your handling code here:
        this.jtf_tienda_descrip.requestFocus();
}//GEN-LAST:event_jtf_tienda_codigobarraActionPerformed

    private void jtf_tienda_descripActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_tienda_descripActionPerformed
        // TODO add your handling code here:
        this.jtf_tienda_precioventa.requestFocus();
}//GEN-LAST:event_jtf_tienda_descripActionPerformed

    private void jtf_tienda_precioventaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_tienda_precioventaActionPerformed
        // TODO add your handling code here:
        this.jtf_tienda_preciorebaja.requestFocus();
}//GEN-LAST:event_jtf_tienda_precioventaActionPerformed

    private void jtf_tienda_preciorebajaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_tienda_preciorebajaActionPerformed
        // TODO add your handling code here:
        this.jtf_tienda_stockmi.requestFocus();
}//GEN-LAST:event_jtf_tienda_preciorebajaActionPerformed

    private void jtf_tienda_stockmiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_tienda_stockmiActionPerformed
        // TODO add your handling code here:
        this.jtf_tiendastockmax.requestFocus();
}//GEN-LAST:event_jtf_tienda_stockmiActionPerformed

    private void jtf_tiendastockmaxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_tiendastockmaxActionPerformed
        // TODO add your handling code here:
        this.jbtn_guardarActionPerformed(evt);
}//GEN-LAST:event_jtf_tiendastockmaxActionPerformed

    private void jbtn_creaentiendaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_creaentiendaActionPerformed
        // TODO add your handling code here:
        if(JOptionPane.showConfirmDialog(null, "El Articulo se Creara en esta Tienda, Esta Correcto?")==0) {
            this.copiar_articulo();
        }
    }//GEN-LAST:event_jbtn_creaentiendaActionPerformed

    private void jbtn_guardarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_guardarActionPerformed
        // TODO add your handling code here:
        if(JOptionPane.showConfirmDialog(null, "Estan Correctos sus Datos?")==0) {
            String tienda=this.jtf_idtiendadetalle.getText();
            if ((tienda.equals("0"))||(tienda.equals("A")))
                {
                    this.guarda_articulo(3);
                }
            else
                {
                    this.guarda_articulo(1);
                }

            
        }
}//GEN-LAST:event_jbtn_guardarActionPerformed

    private void jtf_costoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_costoActionPerformed
        // TODO add your handling code here:
        this.jtf_precio.requestFocus();
}//GEN-LAST:event_jtf_costoActionPerformed

    private void jtf_clave_estadisticaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_clave_estadisticaActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jtf_clave_estadisticaActionPerformed

    private void jtf_descripcion_estadisticaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_descripcion_estadisticaActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jtf_descripcion_estadisticaActionPerformed

    private void jCheckBox2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox2ActionPerformed
        // TODO add your handling code here:
        this.contruir_grafica_ventaspiezas();
}//GEN-LAST:event_jCheckBox2ActionPerformed

    private void jtf_invecontitemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_invecontitemActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jtf_invecontitemActionPerformed

    private void jCheckBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox1ActionPerformed
        // TODO add your handling code here:
        this.contruir_grafica_ventasxmes();
}//GEN-LAST:event_jCheckBox1ActionPerformed

    private void jchk_graficadistribucionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jchk_graficadistribucionActionPerformed
        // TODO add your handling code here:
        this.contruir_grafica_distribuciontotal();
}//GEN-LAST:event_jchk_graficadistribucionActionPerformed

    private void jbtn_crearclaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_crearclaveActionPerformed
        // TODO add your handling code here:
        if(JOptionPane.showConfirmDialog(null, "Desea Crear una Nueva Clave?")==0) {
            int narticulos=jtb_catalogo_derivadas.getRowCount();
            Object[] fnewRow = new Object[7];
            fnewRow[0]="0";
            fnewRow[1]=this.jtf_idclavebase.getText().toString()+String.valueOf(narticulos);
            fnewRow[2]=jtb_catalogo_derivadas.getValueAt(0, 2).toString();
            fnewRow[3]=jtb_catalogo_derivadas.getValueAt(0, 3).toString();
            fnewRow[4]=jtb_catalogo_derivadas.getValueAt(0, 4).toString();
            fnewRow[5]=jtb_catalogo_derivadas.getValueAt(0, 5).toString();
            fnewRow[6]=jtb_catalogo_derivadas.getValueAt(0, 6).toString();
            jtable_modelo_clavesderivadas.addRow(fnewRow);
        }
}//GEN-LAST:event_jbtn_crearclaveActionPerformed

    private void jbtn_guardarderivadasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_guardarderivadasActionPerformed
        // TODO add your handling code here:
        if(JOptionPane.showConfirmDialog(null, "Desea Guardar Claves Generadas?")==0) {
            String texto="",clavederivada="",fechaamericana="",describederibada="",itemderivada="";
            String sidteming[]=this.jcbx_tementrada.getSelectedItem().toString().split(":");
            String sidtemven[]=this.jcbx_temporadasventa.getSelectedItem().toString().split(":");
            String sidlinea[]=this.jcbx_lineaarti.getSelectedItem().toString().split(":");
            fechaamericana=this.fechaamericana(this.jtf_fechaultima.getText());
            int totalfilasreporte=this.jtable_modelo_clavesderivadas.getRowCount(),i=0,id=0;
            for(i=0;i<totalfilasreporte;i++) {
                id=Integer.valueOf(jtable_modelo_clavesderivadas.getValueAt(i, 0).toString());
                if (id==0) {
                    clavederivada=jtable_modelo_clavesderivadas.getValueAt(i, 1).toString();
                    describederibada=jtable_modelo_clavesderivadas.getValueAt(i, 2).toString();
                    itemderivada=jtable_modelo_clavesderivadas.getValueAt(i, 3).toString();
                    texto="select * from x1sieuno_addarticulo_derivados(1,'"+clavederivada+"','','"+describederibada+"','"+this.jtf_ultcosto.getText().replace(",", "")+"','"+this.jtf_precio.getText().replace(",", "")+"','"+this.jtf_idfam.getText()+"','"+this.jtf_idsubfam.getText()+"','"+itemderivada+"','"+fechaamericana+"','"+sidteming[0]+"','"+sidtemven[0]+"','"+sidlinea[0]+"','"+this.jtf_controlalmacen.getText()+"','"+this.jtf_idstatus.getText()+"','"+this.jtf_unidadempaque.getText()+"','"+this.jtf_idsublinea.getText()+"','"+this.jta_observacion.getText().toString().trim().replace("\n", " ").toUpperCase()+"','"+this.jtf_idclavebase.getText()+"')";
                    try {
                        System.out.println(texto);
                        x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                    } catch(Exception e) {
                        System.out.println(e.getMessage());
                    }
                }
            }
        }
    }//GEN-LAST:event_jbtn_guardarderivadasActionPerformed

    private void jchbx_eliminarfilaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jchbx_eliminarfilaActionPerformed
        // TODO add your handling code here:
        int fila = jtb_catalogo_derivadas.getSelectedRow();
        if (fila>0) {
            if(JOptionPane.showConfirmDialog(null, "Desea Eliminar Fila Seleccionada?")==0) {
                jtable_modelo_clavesderivadas.removeRow(fila);
            }
        }
}//GEN-LAST:event_jchbx_eliminarfilaActionPerformed

    private void jcbx_verkardexidbaseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcbx_verkardexidbaseActionPerformed
        // TODO add your handling code here:
        this.carga_datos_kardexdistri_idbase(2,this.jtf_idclavebase.getText().trim(),"0");
}//GEN-LAST:event_jcbx_verkardexidbaseActionPerformed

    private void jTabbedPane1StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jTabbedPane1StateChanged
        // TODO add your handling code here:
        indexactual=this.jTabbedPane1.getSelectedIndex();
        System.out.println("cambiando panel");
        if((indexactual==1) && (yacarguearticulostienda==0) )
            {
               yacarguearticulostienda=1;
               this.carga_datos_articulotodaslastiendas();
               this.carga_datos_articulotodaslasbodegas();
               
            }
        if( (indexactual==2) && (yacargueventaxmes==0) )
            {
               yacargueventaxmes=1;
               this.carga_articulo_estadisticas("0", this.jtf_id.getText().trim());
            }
        if((indexactual==3) && (yacargueestadistica==0))
            {
                if(JOptionPane.showConfirmDialog(null, "Desea Ver estadistica por mes, puede tardar unos minutos?")==0)
                    {
                        System.out.println("hola aqui llega");
                        if (variables_global.getnivelusu()>2)
                            {

                            }
                        else
                            {
                                yacargueestadistica=1;
                                this.carga_articulo_masvenxmes(this.jtf_id.getText().trim());
                            }
                    }
            }

         if((indexactual==4)&&(yacargueventaxmes==0))
            {
               yacargueventaxmes=1;

                this.carga_datos_reportediferencias(0, 0, 4, this.jtf_id.getText().trim());
            }
         if((indexactual==5)&&(yacarguedistrialma==0))
            {
               yacarguedistrialma=1;
                this.carga_datos_distribucionalma(this.jtf_clave.getText().trim());
            }
         if((indexactual==6)&&(yacarguederibadas==0))
            {
               yacarguederibadas=1;
                this.carga_articulo_subclaves(this.jtf_idclavebase.getText().trim());
            }
    }//GEN-LAST:event_jTabbedPane1StateChanged

    private void jbtn_buscarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_buscarActionPerformed
        // TODO add your handling code here:
        String textbusca="";
        textbusca=JOptionPane.showInputDialog("Ingresa Clave:",this.jtf_clave.getText());
        if (textbusca.length() > 0)
            {
                this.carga_datos_general(14,textbusca);
                this.jtf_descripcion.requestFocus();
                yacargueestadistica=0;
                yacargueventaxmes=0;
                yacarguedistrialma=0;
                controlcombotv=0;
                controlcombola=0;
                controlcombote=0;
                yacarguederibadas=0;
                yacarguearticulostienda=0;
                indexjtapestana=0;
                this.jTabbedPane1.setSelectedIndex(0);
        }
}//GEN-LAST:event_jbtn_buscarActionPerformed

    private void jmni_crearclaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_crearclaveActionPerformed
        // TODO add your handling code here:
     
    }//GEN-LAST:event_jmni_crearclaveActionPerformed

    private void jmni_buscarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_buscarActionPerformed
        // TODO add your handling code here:
        this.jbtn_buscarActionPerformed(evt);
    }//GEN-LAST:event_jmni_buscarActionPerformed

    private void jmni_activartiendaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_activartiendaActionPerformed
        // TODO add your handling code here:
        this.jtf_tiendausuario.setEditable(true);
    }//GEN-LAST:event_jmni_activartiendaActionPerformed

    private void jtf_tienda_preciomayoreoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_tienda_preciomayoreoActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jtf_tienda_preciomayoreoActionPerformed

    private void jmni_copiarbodegaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_copiarbodegaActionPerformed
        // TODO add your handling code here:
        if(JOptionPane.showConfirmDialog(null, "Opcion Deshabilitada!!!")==0)
            {
                //this.copiar_articulob();
            }
    }//GEN-LAST:event_jmni_copiarbodegaActionPerformed

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new articulos_sie_editar().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JCheckBox jCheckBox1;
    private javax.swing.JCheckBox jCheckBox2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel33;
    private javax.swing.JLabel jLabel34;
    private javax.swing.JLabel jLabel35;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JMenuItem jMenuItem5;
    private javax.swing.JMenuItem jMenuItem6;
    private javax.swing.JMenuItem jMenuItem7;
    private javax.swing.JMenuItem jMenuItem8;
    private javax.swing.JMenuItem jMenuItem9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel12;
    private javax.swing.JPanel jPanel13;
    private javax.swing.JPanel jPanel14;
    private javax.swing.JPanel jPanel15;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane10;
    private javax.swing.JScrollPane jScrollPane11;
    private javax.swing.JScrollPane jScrollPane12;
    private javax.swing.JScrollPane jScrollPane13;
    private javax.swing.JScrollPane jScrollPane14;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JScrollPane jScrollPane8;
    private javax.swing.JScrollPane jScrollPane9;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JButton jbtn_actualizarfamysub;
    private javax.swing.JButton jbtn_buscar;
    private javax.swing.JButton jbtn_creaentienda;
    private javax.swing.JButton jbtn_crearclave;
    private javax.swing.JButton jbtn_guardar;
    private javax.swing.JButton jbtn_guardarderivadas;
    private javax.swing.JComboBox jcbx_lineaarti;
    private javax.swing.JComboBox jcbx_tementrada;
    private javax.swing.JComboBox jcbx_temporadasventa;
    private javax.swing.JCheckBox jcbx_verkardexidbase;
    private javax.swing.JCheckBox jchbx_eliminarfila;
    private javax.swing.JCheckBox jchk_graficadistribucion;
    private javax.swing.JEditorPane jep_articuloimagen;
    private javax.swing.JEditorPane jep_articuloimagenestadistica;
    private javax.swing.JLabel jlbl_nombretie;
    private javax.swing.JLabel jlbl_tienda;
    private javax.swing.JLabel jlbl_tienda2;
    private javax.swing.JMenuItem jmni_activartienda;
    private javax.swing.JMenuItem jmni_actualizar;
    private javax.swing.JMenuItem jmni_buscar;
    private javax.swing.JMenuItem jmni_copiarbodega;
    private javax.swing.JMenu jmni_crearclave;
    private javax.swing.JMenuItem jmni_crearsugerencia;
    private javax.swing.JMenuItem jmni_escape;
    private javax.swing.JMenuItem jmni_guardar;
    private javax.swing.JMenuItem jmni_salir;
    private javax.swing.JTextArea jta_observacion;
    private javax.swing.JTable jtb_catalogo_articulos;
    private javax.swing.JTable jtb_catalogo_derivadas;
    private javax.swing.JTable jtb_catalogo_distribucionalma;
    private javax.swing.JTable jtb_catalogo_historialfisico;
    private javax.swing.JTable jtbl_articulosentiendas;
    private javax.swing.JTable jtbl_estadisticasarticulo;
    private javax.swing.JTable jtbl_estadisticaventasxmes;
    private javax.swing.JTable jtbl_kardex;
    private javax.swing.JTable jtbl_kardex1;
    private javax.swing.JTable jtbl_kardex2;
    private javax.swing.JTable jtbl_kardexderivadadistribucion;
    private javax.swing.JTextField jtf_clave;
    private javax.swing.JTextField jtf_clave_estadistica;
    private javax.swing.JTextField jtf_codigobarras;
    private javax.swing.JTextField jtf_controlalmacen;
    private javax.swing.JTextField jtf_costo;
    private javax.swing.JTextField jtf_describestatus;
    private javax.swing.JTextField jtf_descripcion;
    private javax.swing.JTextField jtf_descripcion_estadistica;
    private javax.swing.JTextField jtf_existencia;
    private javax.swing.JTextField jtf_familia;
    private javax.swing.JTextField jtf_fechaultima;
    private javax.swing.JTextField jtf_id;
    private javax.swing.JTextField jtf_idclavebase;
    private javax.swing.JTextField jtf_idfam;
    private javax.swing.JTextField jtf_idstatus;
    private javax.swing.JTextField jtf_idsubfam;
    private javax.swing.JTextField jtf_idsublinea;
    private javax.swing.JTextField jtf_idtiendadetalle;
    private javax.swing.JTextField jtf_invecontitem;
    private javax.swing.JTextField jtf_item;
    private javax.swing.JTextField jtf_precio;
    private javax.swing.JTextField jtf_subfamilia;
    private javax.swing.JTextField jtf_sublineadescribe;
    private javax.swing.JTextField jtf_tienda_clave;
    private javax.swing.JTextField jtf_tienda_codigobarra;
    private javax.swing.JTextField jtf_tienda_descrip;
    private javax.swing.JTextField jtf_tienda_ite;
    private javax.swing.JTextField jtf_tienda_preciomayoreo;
    private javax.swing.JTextField jtf_tienda_preciorebaja;
    private javax.swing.JTextField jtf_tienda_precioventa;
    private javax.swing.JTextField jtf_tienda_stockmi;
    private javax.swing.JTextField jtf_tiendastockmax;
    private javax.swing.JTextField jtf_tiendausuario;
    private javax.swing.JTextField jtf_totalexistencia;
    private javax.swing.JTextField jtf_ultcosto;
    private javax.swing.JTextField jtf_unidadempaque;
    // End of variables declaration//GEN-END:variables

}
